2122232425262728
this.eventManager = eventManager; } synchronized void lock() { if(lockCount == 0) eventManager.fireEvent(new WorkspaceLockStatusEvent(true)); lockCount += 1; }
2930313233343536
synchronized void unlock() { if(lockCount == 0) throw new IllegalStateException("Cannot call unlock() on unlocked workspace."); if(lockCount == 1) eventManager.fireEvent(new WorkspaceLockStatusEvent(false)); lockCount -= 1; }