예제 #1
0
파일: lock.py 프로젝트: saminigod/cygwin
 def trylock(self):
     if lock._host is None:
         lock._host = socket.gethostname()
     lockname = '%s:%s' % (lock._host, os.getpid())
     while not self.held:
         try:
             util.makelock(lockname, self.f)
             self.held = 1
         except (OSError, IOError), why:
             if why.errno == errno.EEXIST:
                 locker = self.testlock()
                 if locker is not None:
                     raise LockHeld(errno.EAGAIN, self.f, self.desc,
                                    locker)
             else:
                 raise LockUnavailable(why.errno, why.strerror,
                                       why.filename, self.desc)
예제 #2
0
 def makelock(self, info, path):
     return util.makelock(info, self.join(path))
예제 #3
0
 def makelock(self, info, path):
     return util.makelock(info, self.join(path))