- if(thread->state!=STATE_RUNNING) {
- lose("sig_stop_for_gc_handler: wrong thread state: %ld\n",
- fixnum_value(thread->state));
- }
- thread->state=STATE_SUSPENDED;
- FSHOW_SIGNAL((stderr,"thread=%lu suspended\n",thread->os_thread));
+ /* need the context stored so it can have registers scavenged */
+ fake_foreign_function_call(context);
+
+ /* Block everything. */
+ sigfillset(&ss);
+ thread_sigmask(SIG_BLOCK,&ss,0);
+
+ /* Not pending anymore. */
+ SetSymbolValue(GC_PENDING,NIL,thread);
+ SetSymbolValue(STOP_FOR_GC_PENDING,NIL,thread);
+
+ if(thread->state!=STATE_RUNNING) {
+ lose("sig_stop_for_gc_handler: wrong thread state: %ld\n",
+ fixnum_value(thread->state));
+ }
+
+ thread->state=STATE_SUSPENDED;
+ FSHOW_SIGNAL((stderr,"thread=%lu suspended\n",thread->os_thread));