Mantis - Resin
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
3464 | minor | always | 04-28-09 09:15 | 08-20-09 21:05 | |
|
|||||
Reporter: | ferg | Platform: | |||
Assigned To: | ferg | OS: | |||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | |||
Product Build: | Resolution: | fixed | |||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 4.0.2 | ||
|
|||||
Summary: | 0003464: distributed locking | ||||
Description: |
(rep by Martin Thompson) The semantics I'm looking for would be similar to the following code. public void onLoad() throws InterruptedException { final java.util.concurrent.locks.Lock distributedMasterLock = resinServer.getOrCreateLock("ev-master"); if (distributedMasterLock.tryLock()) { try { promoteToMaster(); // blocking } finally { distributedMasterLock.unlock(); } } else { startSecondaryBackgroundProcesses(); // non-blocking distributedMasterLock.lockInterruptibly(); try { promoteToMaster(); } finally { distributedMasterLock.unlock(); } } } Ideally the locking implementation fits the standard Lock interface and offers semantics like the above. For the secondary waiting on the lock it would be necessary that it aquires the lock almost instantly after the master has released it because of calling unlock or if it dies and just goes away without calling unlock. |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|