projects
/
cdsspec-compiler.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
model: set thread state during 'swap' calls
[cdsspec-compiler.git]
/
threads.cc
diff --git
a/threads.cc
b/threads.cc
index 6adc053ae2dbfc58a00bbbb2f0e6a7c2e79a7b4c..9de580297871687e4529f2a67512aa6087a9cc1b 100644
(file)
--- a/
threads.cc
+++ b/
threads.cc
@@
-84,6
+84,7
@@
int Thread::create_context()
*/
int Thread::swap(Thread *t, ucontext_t *ctxt)
{
+ t->set_state(THREAD_READY);
return swapcontext(&t->context, ctxt);
}
@@
-97,6
+98,7
@@
int Thread::swap(Thread *t, ucontext_t *ctxt)
*/
int Thread::swap(ucontext_t *ctxt, Thread *t)
{
+ t->set_state(THREAD_RUNNING);
return swapcontext(ctxt, &t->context);
}