Skip to content

Commit

Permalink
Nicer sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
burqen committed May 19, 2017
1 parent 7705a2b commit cd4d8ee
Showing 1 changed file with 4 additions and 9 deletions.
Expand Up @@ -19,6 +19,9 @@
*/
package org.neo4j.index.internal.gbptree;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.LockSupport;

import org.neo4j.unsafe.impl.internal.dragons.UnsafeUtil;

class GBPTreeLock
Expand Down Expand Up @@ -88,14 +91,6 @@ private void doUnlock( long targetLockBit )

private void sleep()
{
try
{
Thread.sleep( 10 );
}
catch ( InterruptedException e )
{
// todo what to do in this case
throw new RuntimeException( e );
}
LockSupport.parkNanos( TimeUnit.MILLISECONDS.toNanos( 10 ) );
}
}

0 comments on commit cd4d8ee

Please sign in to comment.