1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +00:00

Fix some merge issues.

Make everything compile, and test-install pass.
This commit is contained in:
Calvin Rose 2019-12-12 17:14:36 -06:00
parent 36b2f27873
commit 7c2ae45809
2 changed files with 5 additions and 9 deletions

View File

@ -114,7 +114,7 @@
# Detect threads # Detect threads
(def env (fiber/getenv (fiber/current))) (def env (fiber/getenv (fiber/current)))
(def threads? (not (not (env 'thread/from-image)))) (def threads? (not (not (env 'thread/new))))
(print "threads " threads?) (print "threads " threads?)

View File

@ -335,10 +335,6 @@ int janet_thread_receive(Janet *msg_out, double timeout) {
/* Check for messages waiting for us */ /* Check for messages waiting for us */
if (mailbox->messageCount > 0) { if (mailbox->messageCount > 0) {
/* If we were over capacity, receiving a message should
* bring us under capacity. We can therefor wake up pending writers. */
int wasAtCapacity = mailbox_at_capacity(mailbox);
/* Hack to capture all panics from marshalling. This works because /* Hack to capture all panics from marshalling. This works because
* we know janet_marshal won't mess with other essential global state. */ * we know janet_marshal won't mess with other essential global state. */
jmp_buf buf; jmp_buf buf;
@ -386,7 +382,7 @@ int janet_thread_receive(Janet *msg_out, double timeout) {
} }
static Janet janet_thread_getter(void *p, Janet key); static int janet_thread_getter(void *p, Janet key, Janet *out);
static JanetAbstractType Thread_AT = { static JanetAbstractType Thread_AT = {
"core/thread", "core/thread",
@ -604,10 +600,10 @@ static const JanetMethod janet_thread_methods[] = {
{NULL, NULL} {NULL, NULL}
}; };
static Janet janet_thread_getter(void *p, Janet key) { static int janet_thread_getter(void *p, Janet key, Janet *out) {
(void) p; (void) p;
if (!janet_checktype(key, JANET_KEYWORD)) janet_panicf("expected keyword method"); if (!janet_checktype(key, JANET_KEYWORD)) return 0;
return janet_getmethod(janet_unwrap_keyword(key), janet_thread_methods); return janet_getmethod(janet_unwrap_keyword(key), janet_thread_methods, out);
} }
static const JanetReg threadlib_cfuns[] = { static const JanetReg threadlib_cfuns[] = {