I have looked through it a lot of times. And could not find any.
private String _nameOfLockingThread = null;
private NSMutableArray _stackTraces = new NSMutableArray();
private NSMutableArray _prevTraces = new NSMutableArray();
public void lock() {
String nameOfCurrentThread = Thread.currentThread().getName();
// prepare filtered stack trace:
String trace = WOLogFormatter.formatTrowable(new Exception());
if (_stackTraces.count() == 0) {
_stackTraces.addObject(trace);
_nameOfLockingThread = nameOfCurrentThread;
} else {
if (nameOfCurrentThread.equals(_nameOfLockingThread)) {
_stackTraces.addObject(trace);
} else {
logger.log(WOLogLevel.INFO,
"Attempting to lock editing context from " + nameOfCurrentThread
+ " that was previously locked in " + _nameOfLockingThread,
new Object[] {session,trace,_stackTraces,_prevTraces});
}
}
super.lock();
}
public void unlock() {
super.unlock();
if (_stackTraces.count() > 0)
_prevTraces.addObject(_stackTraces.removeLastObject());
else
_stackTraces.count();
if (_stackTraces.count() == 0) {
_nameOfLockingThread = null;
_prevTraces.removeAllObjects();
}
}
I think those methods consist of really simple statements that should not cause problems.