Implement the server.lock file

This commit is contained in:
kotyara 2025-04-12 00:24:41 +05:00
parent 90048d5a4c
commit 632f108ad7
3 changed files with 38 additions and 0 deletions

View file

@ -254,3 +254,16 @@ function logg($message, $name, $EOL = true, $level = 2, $close = false){
}
}
}
function release_lock(){
if(LOCK_FILE !== null){
if(!flock(LOCK_FILE, LOCK_UN)){
console("[CRITICAL] Failed to release the server.lock file.");
}
if(!fclose(LOCK_FILE)){
console("[CRITICAL] Could not close server.lock resource.");
}
} else {
console("[CRITICAL] Failed to find the server.lock file.");
}
}