use spinlocks and other fixes
This commit is contained in:
@@ -166,16 +166,9 @@ JSC_CCALL(actor_on_exception,
|
||||
JSC_CCALL(actor_clock,
|
||||
if (!JS_IsFunction(js, argv[0]))
|
||||
return JS_ThrowReferenceError(js, "Argument must be a function.");
|
||||
|
||||
|
||||
cell_rt *actor = JS_GetContextOpaque(js);
|
||||
SDL_LockMutex(actor->msg_mutex);
|
||||
letter l;
|
||||
l.type = LETTER_CALLBACK;
|
||||
l.callback = JS_DupValue(js, argv[0]);
|
||||
arrput(actor->letters, l);
|
||||
SDL_UnlockMutex(actor->msg_mutex);
|
||||
printf("actor %s clocked\n", actor->id);
|
||||
set_actor_state(actor);
|
||||
actor_clock(actor, argv[0]);
|
||||
)
|
||||
|
||||
static const JSCFunctionListEntry js_actor_funcs[] = {
|
||||
|
||||
Reference in New Issue
Block a user