1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +02:00

Better docs for leaving guile mode.

This commit is contained in:
Marius Vollmer 2005-03-04 15:47:48 +00:00
parent e03bb21b83
commit 9ba2fab389

View file

@ -310,23 +310,30 @@ guile mode. The following functions can be used to temporily leave
guile mode or to perform some common blocking operations in a supported guile mode or to perform some common blocking operations in a supported
way. way.
@deftypefn {C Function} scm_t_guile_ticket scm_leave_guile () @deftypefn {C Function} scm_t_guile_ticket scm_leave_guile ()
Leave guile mode and return a ticket that can be used with @deftypefnx {C Function} void scm_enter_guile (scm_t_guile_ticket ticket)
@code{scm_enter_guile} to enter it again. These two functions must be called as a pair and can be used to leave
guile mode temporarily. The call to @code{scm_leave_guile} returns a
ticket that must be used with @code{scm_enter_guile} to match up the two
calls.
While a thread has left guile mode, it must not call any libguile While a thread has left guile mode, it must not call any libguile
functions except @code{scm_enter_guile} and must not use any libguile functions except @code{scm_enter_guile}, @code{scm_with_guile},
macros. Also, local variables of type @code{SCM} that are allocated @code{scm_without_guile} or @code{scm_leave_guile} and must not use any
while not in guile mode are not protected from the garbage collector. libguile macros. Also, local variables of type @code{SCM} that are
@end deftypefn allocated while not in guile mode are not protected from the garbage
collector.
@deftypefn {C Function} void scm_enter_guile (scm_t_guile_ticket ticket) When used from non-guile mode, a pair of calls to @code{scm_leave_guile}
Enter guile mode again. and @code{scm_enter_guile} do nothing. In that way, you can leave guile
mode without having to know whether the current thread is in guile mode
or not.
@end deftypefn @end deftypefn
@deftypefn {C Function} void *scm_without_guile (void *(*func) (void *), void *data) @deftypefn {C Function} void *scm_without_guile (void *(*func) (void *), void *data)
Leave guile mode, call @var{func} on @var{data}, enter guile mode and Leave guile mode as with @code{scm_leave_guile}, call @var{func} on
return the result of calling @var{func}. @var{data}, enter guile mode as with @code{scm_enter_guile} and return
the result of calling @var{func}.
@end deftypefn @end deftypefn
@deftypefn {C Function} int scm_pthread_mutex_lock (pthread_mutex_t *mutex) @deftypefn {C Function} int scm_pthread_mutex_lock (pthread_mutex_t *mutex)