X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fdynbind.c;h=8d8da8c73f96fb3d5bb48f7c7429ec9697712a58;hb=37d3828773e2f847bb1ed7522b0af4fb8e736fc8;hp=32f79f0809bfa0893c5874fd0965117919103f08;hpb=8340bf74c31b29e9552ef8f705b6e1298547c6ab;p=sbcl.git diff --git a/src/runtime/dynbind.c b/src/runtime/dynbind.c index 32f79f0..8d8da8c 100644 --- a/src/runtime/dynbind.c +++ b/src/runtime/dynbind.c @@ -40,7 +40,7 @@ void bind_variable(lispobj symbol, lispobj value, void *th) &((struct symbol *)native_pointer(TLS_INDEX_LOCK))->value; FSHOW_SIGNAL((stderr, "entering dynbind tls alloc\n")); set_pseudo_atomic_atomic(thread); - get_spinlock(tls_index_lock,(long)th); + get_spinlock(tls_index_lock,(uword_t)th); if(!sym->tls_index) { sym->tls_index=SymbolValue(FREE_TLS_INDEX,0); SetSymbolValue(FREE_TLS_INDEX, sym->tls_index+N_WORD_BYTES, 0); @@ -81,6 +81,28 @@ unbind(void *th) } void +unbind_variable(lispobj name, void *th) +{ + struct thread *thread=(struct thread *)th; + struct binding *binding; + lispobj symbol; + + binding = ((struct binding *)get_binding_stack_pointer(thread)) - 1; + + symbol = binding->symbol; + + if (symbol != name) + lose("unbind_variable, 0x%p != 0x%p", symbol, name); + + SetTlSymbolValue(symbol, binding->value,thread); + + binding->symbol = 0; + binding->value = 0; + + set_binding_stack_pointer(thread,binding); +} + +void unbind_to_here(lispobj *bsp,void *th) { struct thread *thread=(struct thread *)th;