summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorivmai <ivmai>2010-10-06 22:09:27 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:55 +0200
commit24b29a7e89dc3b25b4d6933b7aaf49acf19c71a4 (patch)
tree5c6184fca0e66fa8379c77696667275b66653f63 /win32_threads.c
parent34867e9d2269c71f9753f7ce472904f9c4528a28 (diff)
2010-10-06 Ivan Maidanski <ivmai@mail.ru>
* darwin_stop_world.c (FindTopOfStack): Change return type to ptr_t (from long); make GC_INNER; add GC_ prefix. * darwin_stop_world.c (GC_push_all_stacks): Add thread_blocked local variable (initialized from the corresponding GC_thread field unless GC_query_task_threads); add assertion that our thread is not blocked; prefix FindTopOfStack with GC_ and remove no longer needed cast to ptr_t of the result; handle thread blocked case (and remove FIXME); use GC_push_all_stack_sections unless GC_query_task_threads (and remove FIXME). * pthread_support.c (GC_FindTopOfStack): Declare (if needed). * pthread_support.c (GC_do_blocking_inner): Call GC_save_regs_in_stack (if needed) before acquiring the lock. * win32_threads.c (GC_do_blocking_inner): Ditto. * pthread_support.c (GC_do_blocking_inner): Set/clear topOfStack field of GC_thread (Darwin only). * include/private/pthread_support.h (GC_thread): Add topOfStack field for Darwin (unless DARWIN_DONT_PARSE_STACK).
Diffstat (limited to 'win32_threads.c')
-rw-r--r--win32_threads.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/win32_threads.c b/win32_threads.c
index 40f3915..894e10f 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -764,13 +764,16 @@ GC_INNER void GC_do_blocking_inner(ptr_t data, void * context)
struct blocking_data * d = (struct blocking_data *) data;
DWORD t = GetCurrentThreadId();
GC_thread me;
+# ifdef IA64
+ ptr_t stack_ptr = GC_save_regs_in_stack();
+# endif
DCL_LOCK_STATE;
LOCK();
me = GC_lookup_thread_inner(t);
GC_ASSERT(me -> thread_blocked_sp == NULL);
# ifdef IA64
- me -> backing_store_ptr = GC_save_regs_in_stack();
+ me -> backing_store_ptr = stack_ptr;
# endif
me -> thread_blocked_sp = (ptr_t) &d; /* save approx. sp */
/* Save context here if we want to support precise stack marking */