mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
PocketMine.php: get rid of redundant LOCK_FILE_PATH constant
This commit is contained in:
parent
3eea2442a7
commit
9d1239ed67
@ -201,8 +201,7 @@ namespace pocketmine {
|
|||||||
mkdir($dataPath, 0777, true);
|
mkdir($dataPath, 0777, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
define('pocketmine\LOCK_FILE_PATH', $dataPath . 'server.lock');
|
define('pocketmine\LOCK_FILE', fopen($dataPath . 'server.lock', "a+b"));
|
||||||
define('pocketmine\LOCK_FILE', fopen(\pocketmine\LOCK_FILE_PATH, "a+b"));
|
|
||||||
if(!flock(\pocketmine\LOCK_FILE, LOCK_EX | LOCK_NB)){
|
if(!flock(\pocketmine\LOCK_FILE, LOCK_EX | LOCK_NB)){
|
||||||
//wait for a shared lock to avoid race conditions if two servers started at the same time - this makes sure the
|
//wait for a shared lock to avoid race conditions if two servers started at the same time - this makes sure the
|
||||||
//other server wrote its PID and released exclusive lock before we get our lock
|
//other server wrote its PID and released exclusive lock before we get our lock
|
||||||
|
Loading…
x
Reference in New Issue
Block a user