Next: Critical Sections, Previous: Mutexes and Condition Variables, Up: Scheduling
A thread must not block outside of a libguile function while it is in guile mode. The following functions can be used to temporily leave guile mode or to perform some common blocking operations in a supported way.
Leave guile mode, call func on data, enter guile mode and return the result of calling func.
While a thread has left guile mode, it must not call any libguile functions except
scm_with_guileorscm_without_guileand must not use any libguile macros. Also, local variables of typeSCMthat are allocated while not in guile mode are not protected from the garbage collector.When used from non-guile mode, calling
scm_without_guileis still allowed: it simply calls func. In that way, you can leave guile mode without having to know whether the current thread is in guile mode or not.
Like
pthread_mutex_lock, but leaves guile mode while waiting for the mutex.
Like
pthread_cond_waitandpthread_cond_timedwait, but leaves guile mode while waiting for the condition variable.
Like
selectbut leaves guile mode while waiting. Also, the delivery of a system async causes this function to be interrupted with error codeEINTR.