mirror of
https://github.com/corda/corda.git
synced 2025-01-19 03:06:36 +00:00
permit state transitions from idle to exclusive
This commit is contained in:
parent
090cd8a209
commit
e2fc8a62c7
@ -551,7 +551,6 @@ Java_java_lang_Runtime_load(Thread* t, jclass, jstring name, jboolean mapName)
|
||||
extern "C" JNIEXPORT void JNICALL
|
||||
Java_java_lang_Runtime_gc(Thread* t, jobject)
|
||||
{
|
||||
ENTER(t, Thread::ActiveState);
|
||||
ENTER(t, Thread::ExclusiveState);
|
||||
|
||||
collect(t, Heap::MajorCollection);
|
||||
|
@ -2036,13 +2036,21 @@ enter(Thread* t, Thread::State s)
|
||||
|
||||
switch (s) {
|
||||
case Thread::ExclusiveState: {
|
||||
assert(t, t->state == Thread::ActiveState);
|
||||
|
||||
while (t->m->exclusive) {
|
||||
// another thread got here first.
|
||||
ENTER(t, Thread::IdleState);
|
||||
}
|
||||
|
||||
switch (t->state) {
|
||||
case Thread::ActiveState: break;
|
||||
|
||||
case Thread::IdleState: {
|
||||
++ t->m->activeCount;
|
||||
} break;
|
||||
|
||||
default: abort(t);
|
||||
}
|
||||
|
||||
t->state = Thread::ExclusiveState;
|
||||
t->m->exclusive = t;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user