if (setlock(new Lock(LockMode.WRITE), 0) == LockResult.GRANTED)
{
state += value;
if (A.commit() != ActionStatus.COMMITTED)
throw new TestException("Action commit error.");
else
return;
}
else
{
if (printDebug)
System.out.println("Error - could not set write lock.");
}
A.abort();
throw new TestException("Write lock error.");
}