introducing Lock File based locking (for portability) - part implemented.
[vamsas.git] / src / org / vamsas / client / simpleclient / ClientsFile.java
index d8abd2b..cab03cd 100644 (file)
@@ -179,6 +179,9 @@ public class ClientsFile extends ListFile {
    */
   protected int addClient(ClientHandle me, boolean disambiguate) {
     int newclient = 0;
+    int tries=5;
+    while (tries-->0 && !lockFile())
+      try { Thread.sleep(1); } catch (Exception e){};
     if (lockFile()) {
       ClientHandle[] clients = retrieveClientHandles();
       if (me.getClientUrn()==null) {