~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/lockfile.py

  • Committer: Michael Hudson
  • Date: 2008-06-16 09:48:20 UTC
  • mto: This revision was merged to the branch mainline in revision 160.
  • Revision ID: michael.hudson@canonical.com-20080616094820-fgsn8vbl1sqly01h
readme changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
            self._count += 1
58
58
            return True
59
59
        try:
60
 
            fd = os.open(self._filename,
61
 
                         os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0600)
 
60
            fd = os.open(self._filename, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0600)
62
61
            os.close(fd)
63
62
            self._count += 1
64
63
            return True
66
65
            return False
67
66
 
68
67
    def acquire(self):
69
 
        # try over and over, sleeping on exponential backoff with
70
 
        # an upper limit of about 5 seconds
 
68
        # try over and over, sleeping on exponential backoff with an upper limit of about 5 seconds
71
69
        pause = 0.1
72
70
        #max_pause = 5.0
73
71
        max_pause = 0.1