ScmObj Scm_MutexUnlocker(ScmMutex *mutex) { ScmObj p = mutex->unlocker_proc; if (SCM_FALSEP(p)) { /* safe; race is ok here */ p = Scm_MakeSubr(mutex_unlocker, (void*)mutex, 0, 0, SCM_FALSE); mutex->unlocker_proc = p; } return p; }
static void install_release_thunk(ScmVM *vm, ScmObj promise) { /* TODO: the before thunk must be something that prevents restarting the execution process. */ vm->handlers = Scm_Acons(Scm_NullProc(), Scm_MakeSubr(release_promise, (void*)promise, 0, 0, SCM_MAKE_STR("promise_release")), vm->handlers); }