mirror of
https://github.com/corda/corda.git
synced 2025-01-19 11:16:54 +00:00
only enter IdleState if necessary in idleIfNecessary
There's no need to enter IdleState (and incur synchronization overhead) unless another thread is waiting to enter ExclusiveState. This change improves the performance of the MemoryRamp test by a factor of about 100.
This commit is contained in:
parent
40b78d888d
commit
b16dd4e63f
@ -2981,7 +2981,9 @@ gcIfNecessary(MyThread* t)
|
|||||||
|
|
||||||
void idleIfNecessary(MyThread* t)
|
void idleIfNecessary(MyThread* t)
|
||||||
{
|
{
|
||||||
ENTER(t, Thread::IdleState);
|
if (UNLIKELY(t->m->exclusive)) {
|
||||||
|
ENTER(t, Thread::IdleState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
|
@ -768,7 +768,9 @@ pushField(Thread* t, object target, object field)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void safePoint(Thread* t) {
|
void safePoint(Thread* t) {
|
||||||
ENTER(t, Thread::IdleState);
|
if (UNLIKELY(t->m->exclusive)) {
|
||||||
|
ENTER(t, Thread::IdleState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object
|
object
|
||||||
|
Loading…
Reference in New Issue
Block a user