Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Unity-Technologies/bdwgc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2019-09-16 11:39:42 +0300
committerJonathan Chambers <jonathan@unity3d.com>2022-03-16 20:58:49 +0300
commit79197cea27bc596132d4e55b250a68ad5ef2db76 (patch)
tree314a0a38b6a3c428b135de8111ef68d1fb51adfa
parent61cef4f1fbe98aadfedae3d10a2fd9d0a301fd4d (diff)
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.
-rw-r--r--win32_threads.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/win32_threads.c b/win32_threads.c
index b6141bb0..650fe815 100644
--- a/win32_threads.c
+++ b/win32_threads.c
@@ -1509,6 +1509,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(). */
@@ -1516,6 +1517,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");