diff options
author | Mark H Weaver <mhw@netris.org> | 2012-01-18 02:53:05 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2012-01-21 03:23:02 -0500 |
commit | ad432bc8317c33899efc29854550b67f3d7babf7 (patch) | |
tree | fb43ba58394dac9137a78d9424673b440f8b1c33 /libguile/threads.c | |
parent | d47db067b63089880e2e202d5a33fd7fe5e41dbe (diff) | |
download | guile-ad432bc8317c33899efc29854550b67f3d7babf7.tar.gz |
Universally-unique gensyms
* libguile/symbols.c (scm_gensym): Make the gensym counter a 128-bit
thread-local, initialized to a random number upon the first call to
`gensym' within a given thread. This counter is rendered as a 22 byte
suffix of mostly base64 digits.
* libguile/threads.h (scm_i_thread): Add a thread-local gensym_counter.
* libguile/threads.c (guilify_self_1): Initialize gensym_counter to NULL.
Diffstat (limited to 'libguile/threads.c')
-rw-r--r-- | libguile/threads.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libguile/threads.c b/libguile/threads.c index 5a13e5ccf..67834ffc8 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -545,6 +545,7 @@ guilify_self_1 (struct GC_stack_base *base) t.join_queue = SCM_EOL; t.dynamic_state = SCM_BOOL_F; t.dynwinds = SCM_EOL; + t.gensym_counter = NULL; t.active_asyncs = SCM_EOL; t.block_asyncs = 1; t.pending_asyncs = 1; |