summaryrefslogtreecommitdiff
path: root/win32_threads.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2019-09-16 11:39:42 +0300
committerIvan Maidanski <ivmai@mail.ru>2019-09-16 11:39:42 +0300
commit190e18c75b2d1f669ee3bc767f34542fd73b2961 (patch)
treec9cf0f12c57a39e15f3f22bc8443f25f9f7c0b1e /win32_threads.c
parentfa8b4826dab484ed304f29730e4e329be0696e93 (diff)
downloadbdwgc-190e18c75b2d1f669ee3bc767f34542fd73b2961.tar.gz
Add assertion that thread is suspended when using context registers
* win32_threads.c (GC_push_stack_for): Add assertion that thread is suspended (before using context registers) if thread is not self and not blocked.
Diffstat (limited to 'win32_threads.c')
-rw-r--r--win32_threads.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/win32_threads.c b/win32_threads.c
index 3a44f563..bd1bbc86 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -1600,6 +1600,7 @@ STATIC word GC_push_stack_for(GC_thread thread, DWORD me)
/* require looping. */
word *regs = thread->context_regs;
+ GC_ASSERT(thread->suspended);
sp = thread->context_sp;
# else
/* For unblocked threads call GetThreadContext(). */
@@ -1607,6 +1608,7 @@ STATIC word GC_push_stack_for(GC_thread thread, DWORD me)
{
CONTEXT context;
+ GC_ASSERT(thread->suspended);
context.ContextFlags = GET_THREAD_CONTEXT_FLAGS;
if (!GetThreadContext(THREAD_HANDLE(thread), &context))
ABORT("GetThreadContext failed");