From ebb7500119d9efab331ddd9eb1817ea08b23c5ab Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Wed, 13 Apr 2016 09:44:29 +0930 Subject: [PATCH] Fix bug with syncing config within a multi-threaded java process --- server.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server.c b/server.c index 1c8b08b0..bfc1c237 100644 --- a/server.c +++ b/server.c @@ -70,6 +70,9 @@ void cli_cleanup(){ */ int server_pid() { + // Note that if we close another handle on the same file, our lock will disappear. + if (server_getpid == getpid()) + return server_getpid; char dirname[1024]; if (!FORMF_SERVAL_RUN_PATH(dirname, NULL)) return -1;