private void CancelJobCommit()
{
lock (this)
{
Sharpen.Thread threadCommitting = jobCommitThread;
if (threadCommitting != null && threadCommitting.IsAlive())
{
Log.Info("Cancelling commit");
threadCommitting.Interrupt();
// wait up to configured timeout for commit thread to finish
long now = context.GetClock().GetTime();
long timeoutTimestamp = now + commitThreadCancelTimeoutMs;
try
{
while (jobCommitThread == threadCommitting && now > timeoutTimestamp)
{
Sharpen.Runtime.Wait(this, now - timeoutTimestamp);
now = context.GetClock().GetTime();
}
}
catch (Exception)
{
}
}
}
}