Lines Matching defs:lock

35    foo.lock -- lock file for reading and writing the other files
82 All three operations are wrapped by a lock/unlock procedure. In order to
83 gain exclusive access to the log files, first a foo.lock file must be
84 exclusively created. When all operations are complete, the lock is
85 released by deleting the foo.lock file. If when attempting to create the
86 lock file, it already exists and the modify time of the lock file is more
88 lock file is considered stale and deleted, and the exclusive creation of
89 the lock file is retried. To assure that there are no false assessments
90 of the staleness of the lock file, the operations periodically touch the
91 lock file to update the modified date.
153 - Exclusively create the foo.lock file using the O_CREAT and O_EXCL modes of
154 the system open() call. If the modify time of an existing lock file is
155 more than PATIENCE seconds old, then the lock file is deleted and the
162 - Delete the foo.lock file.
196 a compress operation.) During this process, the foo.lock file is
257 /* how old the lock file can be in seconds before considering it stale */
302 time_t lock; /* last modify time of our lock file */
339 /* Exclusively create foo.lock in order to negotiate exclusive access to the
340 foo.* files. If the modify time of an existing lock file is greater than
341 PATIENCE seconds in the past, then consider the lock file to have been
342 abandoned, delete it, and try the exclusive create again. Save the lock
346 abandoned lock file a smidge sooner and deleting it, so those are not
353 strcpy(log->end, ".lock");
365 log->lock = st.st_mtime;
369 /* Update the modify time of the lock file to now, in order to prevent another
370 task from thinking that the lock is stale. Save the lock file modify time
376 strcpy(log->end, ".lock");
379 log->lock = st.st_mtime;
383 this is not our lock. If it is our lock, touch it to keep it. */
388 strcpy(log->end, ".lock");
389 if (stat(log->path, &st) || st.st_mtime != log->lock)
395 /* Unlock a previously acquired lock, but only if it's ours. */
400 strcpy(log->end, ".lock");
402 log->lock = 0;
797 /* Close the foo.gz file (if open) and release the lock. */
807 first creating the foo.lock file to gain exclusive access to the foo.*
810 creating the lock file due to access restrictions, or an error reading or
813 field), then return true. If there is an error, the lock is released.
814 Otherwise, the lock is left in place. */
819 /* release open file resource if left over -- can occur if lock lost
861 /* touch the lock file to prevent another process from grabbing it */
922 /* see if we lost the lock -- if so get it again and reload the extra
1008 /* see if we lost the lock -- if so get it again and reload the extra
1052 /* close the log file and release the lock */