From: Daniel B. <da...@us...> - 2003-08-22 03:17:05
|
Update of /cvsroot/sbcl/sbcl/src/runtime In directory sc8-pr-cvs1:/tmp/cvs-serv6509/src/runtime Modified Files: Tag: stop_the_world_branch gencgc.c thread.c Log Message: 0.8.2.38.stop_the_world.5 Lock around SUB-GC to remove window that may allow two threads to attempt to collect at once. WITHOUT-INTERRUPTS around SUB-GC to protect c-level spinlocks used in gc_{stop,start}_the_world (C-level spinlocks are just integers manipulated by get_spinlock(), release_spinlock(). There's no unwind-protect or anything involved in their use, so a thread interrupted when it's holding one of these will continue to hold it) Index: gencgc.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/gencgc.c,v retrieving revision 1.35.2.3 retrieving revision 1.35.2.4 diff -u -d -r1.35.2.3 -r1.35.2.4 --- gencgc.c 20 Aug 2003 19:20:50 -0000 1.35.2.3 +++ gencgc.c 21 Aug 2003 13:30:26 -0000 1.35.2.4 @@ -577,7 +577,7 @@ (lispobj)(((char *)heap_base) + last_free_page*4096), 0); } - free_pages_lock=0; + release_spinlock(&free_pages_lock); /* we can do this after releasing free_pages_lock */ if (gencgc_zero_check) { @@ -823,7 +823,7 @@ page_table[next_page].allocated = FREE_PAGE; next_page++; } - free_pages_lock=0; + release_spinlock(&free_pages_lock); /* alloc_region is per-thread, we're ok to do this unlocked */ gc_set_region_empty(alloc_region); } @@ -966,7 +966,7 @@ SetSymbolValue(ALLOCATION_POINTER, (lispobj)(((char *)heap_base) + last_free_page*4096),0); } - free_pages_lock=0; + release_spinlock(&free_pages_lock); return((void *)(page_address(first_page)+orig_first_page_bytes_used)); } Index: thread.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/thread.c,v retrieving revision 1.11.2.3 retrieving revision 1.11.2.4 diff -u -d -r1.11.2.3 -r1.11.2.4 --- thread.c 20 Aug 2003 10:59:42 -0000 1.11.2.3 +++ thread.c 21 Aug 2003 13:30:26 -0000 1.11.2.4 @@ -212,7 +212,7 @@ * to ensure that we don't have >1 thread with pid=0 on the list at once */ protect_control_stack_guard_page(th->pid,1); - all_threads_lock=0; + release_spinlock(&all_threads_lock); th->pid=kid_pid; /* child will not start until this is set */ #ifndef LISP_FEATURE_SB_THREAD new_thread_trampoline(all_threads); /* call_into_lisp */ |