refactored mutexes to use java ReentrantLock
This commit is contained in:
parent
5871e1b152
commit
18a7fcc0b3
3 changed files with 63 additions and 72 deletions
|
|
@ -27,18 +27,10 @@ class ProcessManagerTestImplementation extends ProcessManager {
|
|||
|
||||
super.releaseLock(pid);
|
||||
|
||||
} catch (TimeoutException e) {
|
||||
System.err.println("[!!] Long Call wasnt able to grab lock!");
|
||||
return;
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
super.releaseLock(pid); // this doesnt happen, dont cancel this task
|
||||
System.err.println("[3] Released lock: interrupted");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean reportLockState(int pid) {
|
||||
return super.lockMap.get(pid);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue