public void TryApplyGlobalSlice()
{
if (GlobalBufferLock.TryLock())
{
/*
* The global buffer must be locked but we don't need to update them if
* there is an update going on right now. It is sufficient to apply the
* deletes that have been added after the current in-flight global slices
* tail the next time we can get the lock!
*/
try
{
if (UpdateSlice(GlobalSlice))
{
// System.out.println(Thread.currentThread() + ": apply globalSlice");
GlobalSlice.Apply(GlobalBufferedUpdates, BufferedUpdates.MAX_INT);
}
}
finally
{
GlobalBufferLock.Unlock();
}
}
}