mirror of
https://github.com/corda/corda.git
synced 2025-02-02 09:18:13 +00:00
leave thread in JoinedState instead of ZombieState in DetachCurrentThread
This commit is contained in:
parent
01dcb1661b
commit
0eba1eeaf2
@ -77,8 +77,17 @@ DetachCurrentThread(Machine* m)
|
|||||||
{
|
{
|
||||||
Thread* t = static_cast<Thread*>(m->localThread->get());
|
Thread* t = static_cast<Thread*>(m->localThread->get());
|
||||||
if (t) {
|
if (t) {
|
||||||
|
expect(t, t != m->rootThread);
|
||||||
|
|
||||||
m->localThread->set(0);
|
m->localThread->set(0);
|
||||||
t->exit();
|
|
||||||
|
ACQUIRE_RAW(t, t->m->stateLock);
|
||||||
|
|
||||||
|
enter(t, Thread::ActiveState);
|
||||||
|
enter(t, Thread::ZombieState);
|
||||||
|
|
||||||
|
t->state = Thread::JoinedState;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -129,7 +129,7 @@ class MySystem: public System {
|
|||||||
|
|
||||||
virtual void join() {
|
virtual void join() {
|
||||||
int rv UNUSED = pthread_join(thread, 0);
|
int rv UNUSED = pthread_join(thread, 0);
|
||||||
//expect(s, rv == 0);
|
expect(s, rv == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void dispose() {
|
virtual void dispose() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user