git://source.jalview.org
/
vamsas.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added simple semaphore file mechanism for session directory.
[vamsas.git]
/
src
/
org
/
vamsas
/
client
/
simpleclient
/
Lock.java
diff --git
a/src/org/vamsas/client/simpleclient/Lock.java
b/src/org/vamsas/client/simpleclient/Lock.java
index
175728e
..
dfc978e
100644
(file)
--- a/
src/org/vamsas/client/simpleclient/Lock.java
+++ b/
src/org/vamsas/client/simpleclient/Lock.java
@@
-9,7
+9,7
@@
import java.nio.channels.FileLock;
/**
* transient object representing a file lock
* This lock should hold for all processes interacting in a session.
/**
* transient object representing a file lock
* This lock should hold for all processes interacting in a session.
- *
+ * TODO: currently implemented for local filesystem style locking - need a fallback mechanism for systems without file locks.
* @author jimp
*
*/
* @author jimp
*
*/
@@
-55,6
+55,7
@@
public class Lock {
}
public void release() {
try {
}
public void release() {
try {
+ // TODO: verify that channel.close should be called after release() for rigourous locking.
if (lock!=null && lock.isValid())
lock.release();
if (rafile!=null && rafile.getChannel().isOpen())
if (lock!=null && lock.isValid())
lock.release();
if (rafile!=null && rafile.getChannel().isOpen())