mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 22:31:12 +02:00
Removed scm_leave_guile, scm_enter_guile and all references to
them since they are no longer in the API.
This commit is contained in:
parent
b54df25486
commit
54428bb84e
3 changed files with 26 additions and 37 deletions
|
@ -13,9 +13,9 @@ put itself into guile mode with either @code{scm_with_guile} or
|
|||
@code{scm_init_guile}. The global state of Guile is initialized
|
||||
automatically when the first thread enters guile mode.
|
||||
|
||||
When a thread wants to block outside of a Guile API function, it should
|
||||
leave guile mode temporarily with either @code{scm_without_guile} or
|
||||
@code{scm_leave_guile}, @xref{Blocking}.
|
||||
When a thread wants to block outside of a Guile API function, it
|
||||
should leave guile mode temporarily with @code{scm_without_guile},
|
||||
@xref{Blocking}.
|
||||
|
||||
Threads that are created by @code{call-with-new-thread} or
|
||||
@code{scm_spawn_thread} start out in guile mode so you don't need to
|
||||
|
@ -51,8 +51,8 @@ See @code{scm_init_guile} for another approach at initializing Guile
|
|||
that does not have this restriction.
|
||||
|
||||
It is OK to call @code{scm_with_guile} while a thread has temporarily
|
||||
left guile mode via @code{scm_without_guile} or @code{scm_leave_guile}.
|
||||
It will then simply temporarily enter guile mode again.
|
||||
left guile mode via @code{scm_without_guile}. It will then simply
|
||||
temporarily enter guile mode again.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {C Function} void scm_init_guile ()
|
||||
|
|
|
@ -452,30 +452,20 @@ guile mode. The following functions can be used to temporily leave
|
|||
guile mode or to perform some common blocking operations in a supported
|
||||
way.
|
||||
|
||||
@deftypefn {C Function} scm_t_guile_ticket scm_leave_guile ()
|
||||
@deftypefnx {C Function} void scm_enter_guile (scm_t_guile_ticket ticket)
|
||||
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.
|
||||
@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
|
||||
return the result of calling @var{func}.
|
||||
|
||||
While a thread has left guile mode, it must not call any libguile
|
||||
functions except @code{scm_enter_guile}, @code{scm_with_guile},
|
||||
@code{scm_without_guile} or @code{scm_leave_guile} and must not use any
|
||||
libguile macros. Also, local variables of type @code{SCM} that are
|
||||
allocated while not in guile mode are not protected from the garbage
|
||||
collector.
|
||||
functions except @code{scm_with_guile} or @code{scm_without_guile} and
|
||||
must not use any libguile macros. Also, local variables of type
|
||||
@code{SCM} that are allocated while not in guile mode are not
|
||||
protected from the garbage collector.
|
||||
|
||||
When used from non-guile mode, a pair of calls to @code{scm_leave_guile}
|
||||
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
|
||||
|
||||
@deftypefn {C Function} {void *} scm_without_guile (void *(*func) (void *), void *data)
|
||||
Leave guile mode as with @code{scm_leave_guile}, call @var{func} on
|
||||
@var{data}, enter guile mode as with @code{scm_enter_guile} and return
|
||||
the result of calling @var{func}.
|
||||
When used from non-guile mode, calling @code{scm_without_guile} is
|
||||
still allowed: it simply calls @var{func}. In that way, you can leave
|
||||
guile mode without having to know whether the current thread is in
|
||||
guile mode or not.
|
||||
@end deftypefn
|
||||
|
||||
@deftypefn {C Function} int scm_pthread_mutex_lock (pthread_mutex_t *mutex)
|
||||
|
|
|
@ -451,17 +451,16 @@ that are stored in local variables. When a thread puts itself into
|
|||
guile mode for the first time, it gets a Scheme representation and is
|
||||
listed by @code{all-threads}, for example.
|
||||
|
||||
While in guile mode, a thread promises to reach a safe point reasonably
|
||||
frequently (@pxref{Asynchronous Signals}). In addition to running
|
||||
signal handlers, these points are also potential rendezvous points of
|
||||
all guile mode threads where Guile can orchestrate global things like
|
||||
garbage collection. Consequently, when a thread in guile mode blocks
|
||||
and does no longer frequent safe points, it might cause all other guile
|
||||
mode threads to block as well. To prevent this from happening, a guile
|
||||
mode thread should either only block in libguile functions (who know how
|
||||
to do it right), or should temporarily leave guile mode with
|
||||
@code{scm_without_guile} or
|
||||
@code{scm_leave_guile}/@code{scm_enter_guile}.
|
||||
While in guile mode, a thread promises to reach a safe point
|
||||
reasonably frequently (@pxref{Asynchronous Signals}). In addition to
|
||||
running signal handlers, these points are also potential rendezvous
|
||||
points of all guile mode threads where Guile can orchestrate global
|
||||
things like garbage collection. Consequently, when a thread in guile
|
||||
mode blocks and does no longer frequent safe points, it might cause
|
||||
all other guile mode threads to block as well. To prevent this from
|
||||
happening, a guile mode thread should either only block in libguile
|
||||
functions (who know how to do it right), or should temporarily leave
|
||||
guile mode with @code{scm_without_guile}.
|
||||
|
||||
For some common blocking operations, Guile provides convenience
|
||||
functions. For example, if you want to lock a pthread mutex while in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue