Skip to content
Snippets Groups Projects
Commit ab489f5d authored by deuce's avatar deuce
Browse files

Fix bug in read lock detection, work around problem when js.auto_terminate

is true and the script exited becuase of that.
parent a278ff1e
No related branches found
No related tags found
No related merge requests found
......@@ -57,7 +57,7 @@ function Lock(filename, lockid, forwrite, timeout)
if(LockedFiles[filename]!=undefined)
file_remove(readlock.name);
/* We have got the lock... wait for all read locks to close */
while(file_exists(filename+".lock_*")) {
while(file_exists(filename+".lock.*")) {
mswait(1);
if(system.timer > endtime) {
/* If we were upgrading, restor our old lock... */
......@@ -111,7 +111,10 @@ function Unlock(filename)
function UnlockAll()
{
var old_at=js.auto_terminate;
js.auto_terminate=false;
for(filename in LockedFiles) {
Unlock(filename);
}
js.auto_terminate=old_at;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment