summaryrefslogtreecommitdiff
path: root/libguile/threads.h
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.h
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.h')
-rw-r--r--libguile/threads.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libguile/threads.h b/libguile/threads.h
index ec129bc72..3660a58d4 100644
--- a/libguile/threads.h
+++ b/libguile/threads.h
@@ -81,6 +81,10 @@ typedef struct scm_i_thread {
SCM dynamic_state;
SCM dynwinds;
+ /* Thread-local gensym counter.
+ */
+ unsigned char *gensym_counter;
+
/* For system asyncs.
*/
SCM active_asyncs; /* The thunks to be run at the next