mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 06:41:13 +02:00
Add comment about `GC_local_malloc ()' upon thread destruction.
* libguile/threads.c (on_thread_exit): Add caveat about possible segfault. git-archimport-id: lcourtes@laas.fr--2006-libre/guile-core--boehm-gc--0--patch-8
This commit is contained in:
parent
071e0d9329
commit
35747a3e06
1 changed files with 11 additions and 0 deletions
|
@ -512,6 +512,17 @@ on_thread_exit (void *v)
|
||||||
|
|
||||||
/* Unblocking the joining threads needs to happen in guile mode
|
/* Unblocking the joining threads needs to happen in guile mode
|
||||||
since the queue is a SCM data structure. */
|
since the queue is a SCM data structure. */
|
||||||
|
|
||||||
|
/* Note: `scm_with_guile ()' invokes `GC_local_malloc ()', which accesses
|
||||||
|
thread-local storage (TLS). If said storage is accessed using
|
||||||
|
`pthread_getspecific ()', then it may be inaccessible at this point,
|
||||||
|
having been destroyed earlier, since the invocation order of destructors
|
||||||
|
associated with pthread keys is unspecified:
|
||||||
|
|
||||||
|
http://www.opengroup.org/onlinepubs/009695399/functions/pthread_key_create.html
|
||||||
|
|
||||||
|
Thus, `libgc' *must* be compiled with `USE_COMPILER_TLS' for this code
|
||||||
|
to work. */
|
||||||
scm_with_guile (do_thread_exit, v);
|
scm_with_guile (do_thread_exit, v);
|
||||||
|
|
||||||
/* Removing ourself from the list of all threads needs to happen in
|
/* Removing ourself from the list of all threads needs to happen in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue