From c02ebd25b6432a5100260ec4a6d3ec3f13c77d2e Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Fri, 18 Dec 1998 00:10:54 +0000 Subject: FileLock.steal(): New method which just basically writes a new PID into the lock file. USE WITH CAUTION. Necessary because in the new news/mail gating code, the parent acquires the lock, and if successful, the child will steal it from the parent and then unlock it when done. This should be safe, with a very small race window, if any. --- Mailman/LockFile.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Mailman/LockFile.py') diff --git a/Mailman/LockFile.py b/Mailman/LockFile.py index e8f44675b..3fb7a5244 100644 --- a/Mailman/LockFile.py +++ b/Mailman/LockFile.py @@ -167,3 +167,7 @@ class FileLock: return 0 pid, winner = self.__read() return pid == os.getpid() + + # use with caution!!! + def steal(self): + self.__write() -- cgit v1.2.3-70-g09d2