summaryrefslogtreecommitdiff
path: root/libguile/threads.c
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2012-01-18 02:53:05 -0500
committerMark H Weaver <mhw@netris.org>2012-01-21 03:23:02 -0500
commitad432bc8317c33899efc29854550b67f3d7babf7 (patch)
treefb43ba58394dac9137a78d9424673b440f8b1c33 /libguile/threads.c
parentd47db067b63089880e2e202d5a33fd7fe5e41dbe (diff)
downloadguile-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.c1
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;