From 95e8875f5aeb5291a4bbd1b26c5a0522c491b0dd Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Thu, 13 Oct 2011 14:49:08 +0200 Subject: better locking --- src/meetingtools/apps/room/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/meetingtools/apps/room/models.py b/src/meetingtools/apps/room/models.py index 38ae12c..731e8b9 100644 --- a/src/meetingtools/apps/room/models.py +++ b/src/meetingtools/apps/room/models.py @@ -61,8 +61,10 @@ class Room(models.Model): def _lockf(self): return "%s%sroom-%d.lock" % (LOCK_DIR,os.sep,+self.id) - def lock(self): - f = open(self._lockf()) + def lock(self,msg=None): + f = open(self._lockf(),'w') + if msg: + f.write(msg) f.close() def unlock(self): -- cgit v1.1