1.0.28.65: fix compiling with *PROFILE-HASH-CACHE* set to T
[sbcl.git] / src / runtime / dynbind.c
index 77dfd88..9a64a0a 100644 (file)
@@ -13,6 +13,9 @@
  * files for more information.
  */
 
+#include <stdio.h>
+#include <stdlib.h>
+
 #include "sbcl.h"
 #include "runtime.h"
 #include "globals.h"
@@ -44,7 +47,7 @@ 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);
+            FSHOW_SIGNAL((stderr, "entering dynbind tls alloc\n"));
             set_pseudo_atomic_atomic(th);
             get_spinlock(tls_index_lock,(long)th);
             if(!sym->tls_index) {
@@ -56,6 +59,7 @@ void bind_variable(lispobj symbol, lispobj value, void *th)
                 }
             }
             release_spinlock(tls_index_lock);
+            FSHOW_SIGNAL((stderr, "exiting dynbind tls alloc\n"));
             clear_pseudo_atomic_atomic(th);
             if (get_pseudo_atomic_interrupted(th))
                 do_pending_interrupt();
@@ -81,6 +85,7 @@ unbind(void *th)
     SetTlSymbolValue(symbol, binding->value,thread);
 
     binding->symbol = 0;
+    binding->value = 0;
 
     SetBSP(binding);
 }
@@ -102,6 +107,7 @@ unbind_to_here(lispobj *bsp,void *th)
                 SetTlSymbolValue(symbol, binding->value,thread);
             }
             binding->symbol = 0;
+            binding->value = 0;
         }
     }
     SetBSP(binding);