0.9.18.2: Win32 exceptions
[sbcl.git] / src / runtime / thread.c
index b10ea3c..262e642 100644 (file)
@@ -224,6 +224,7 @@ new_thread_trampoline(struct thread *th)
 {
     lispobj function;
     int result, lock_ret;
+
     FSHOW((stderr,"/creating thread %lu\n", thread_self()));
     function = th->no_tls_value_marker;
     th->no_tls_value_marker = NO_TLS_VALUE_MARKER_WIDETAG;
@@ -245,6 +246,9 @@ new_thread_trampoline(struct thread *th)
     gc_assert(lock_ret == 0);
 
     result = funcall0(function);
+
+    /* Block GC */
+    block_blockable_signals();
     th->state=STATE_DEAD;
 
     /* SIG_STOP_FOR_GC is blocked and GC might be waiting for this
@@ -332,8 +336,7 @@ create_thread_struct(lispobj initial_function) {
         STATIC_TLS_INIT(CONTROL_STACK_END,control_stack_end);
         STATIC_TLS_INIT(ALIEN_STACK,alien_stack_pointer);
 #if defined(LISP_FEATURE_X86) || defined (LISP_FEATURE_X86_64)
-        STATIC_TLS_INIT(PSEUDO_ATOMIC_ATOMIC,pseudo_atomic_atomic);
-        STATIC_TLS_INIT(PSEUDO_ATOMIC_INTERRUPTED,pseudo_atomic_interrupted);
+        STATIC_TLS_INIT(PSEUDO_ATOMIC_BITS,pseudo_atomic_bits);
 #endif
 #undef STATIC_TLS_INIT
     }
@@ -357,8 +360,7 @@ create_thread_struct(lispobj initial_function) {
     th->alien_stack_pointer=((void *)th->alien_stack_start);
 #endif
 #if defined(LISP_FEATURE_X86) || defined (LISP_FEATURE_X86_64)
-    th->pseudo_atomic_interrupted=0;
-    th->pseudo_atomic_atomic=0;
+    th->pseudo_atomic_bits=0;
 #endif
 #ifdef LISP_FEATURE_GENCGC
     gc_set_region_empty(&th->alloc_region);
@@ -377,8 +379,7 @@ create_thread_struct(lispobj initial_function) {
 #if defined(LISP_FEATURE_X86) || defined (LISP_FEATURE_X86_64)
     SetSymbolValue(BINDING_STACK_POINTER,(lispobj)th->binding_stack_pointer,th);
     SetSymbolValue(ALIEN_STACK,(lispobj)th->alien_stack_pointer,th);
-    SetSymbolValue(PSEUDO_ATOMIC_ATOMIC,(lispobj)th->pseudo_atomic_atomic,th);
-    SetSymbolValue(PSEUDO_ATOMIC_INTERRUPTED,th->pseudo_atomic_interrupted,th);
+    SetSymbolValue(PSEUDO_ATOMIC_BITS,(lispobj)th->pseudo_atomic_bits,th);
 #else
     current_binding_stack_pointer=th->binding_stack_pointer;
     current_control_stack_pointer=th->control_stack_start;
@@ -402,6 +403,8 @@ create_thread_struct(lispobj initial_function) {
     }
     th->interrupt_data->pending_handler = 0;
     th->no_tls_value_marker=initial_function;
+
+    th->stepping = NIL;
     return th;
 }