X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fdynbind.c;h=bb964bf6e295e8de25462d92150889b68d5c73bc;hb=f12b298a4ce9090470000360b49523e56475a680;hp=f2e51ef514afbcbcf3a9cd3e8b96b42c6da35b9e;hpb=6288613dfa8fafaa575dfc61eb11e2950494a5b1;p=sbcl.git diff --git a/src/runtime/dynbind.c b/src/runtime/dynbind.c index f2e51ef..bb964bf 100644 --- a/src/runtime/dynbind.c +++ b/src/runtime/dynbind.c @@ -44,13 +44,15 @@ void bind_variable(lispobj symbol, lispobj value, void *th) if(!sym->tls_index) { lispobj *tls_index_lock= &((struct symbol *)native_pointer(TLS_INDEX_LOCK))->value; - clear_pseudo_atomic_interrupted(th); set_pseudo_atomic_atomic(th); get_spinlock(tls_index_lock,(long)th); if(!sym->tls_index) { sym->tls_index=SymbolValue(FREE_TLS_INDEX,0); SetSymbolValue(FREE_TLS_INDEX, make_fixnum(fixnum_value(sym->tls_index)+1),0); + if(fixnum_value(sym->tls_index)>=TLS_SIZE) { + lose("Thread local storage exhausted."); + } } release_spinlock(tls_index_lock); clear_pseudo_atomic_atomic(th); @@ -78,6 +80,7 @@ unbind(void *th) SetTlSymbolValue(symbol, binding->value,thread); binding->symbol = 0; + binding->value = 0; SetBSP(binding); } @@ -99,6 +102,7 @@ unbind_to_here(lispobj *bsp,void *th) SetTlSymbolValue(symbol, binding->value,thread); } binding->symbol = 0; + binding->value = 0; } } SetBSP(binding);