Lines Matching +full:lock +full:- +full:- +full:- +full:-

30 .Nd execute a command while holding a file lock
45 utility acquires an exclusive lock on a
51 While holding the lock, it executes a
59 releases the lock, and removes the
64 .Bx Ns -style
69 is not considered to constitute a lock.
90 This can be used to lock inside a shell script.
98 This will guarantee lock ordering, as well as implement
100 with concurrent unlink, drop and re-acquire activity.
104 option is not used, then no guarantees around lock ordering can be made.
107 .Bl -tag -width ".Fl t Ar seconds"
109 Causes the lock file to be kept (not removed) after the command
115 Failure to acquire the lock is indicated only in the exit status.
119 to fail if the specified lock
156 Specifies a timeout for waiting for the lock.
159 waits indefinitely to acquire the lock.
167 will fail unless it can acquire the lock immediately.
168 When a lock times out,
180 has been opened read-only cannot be exclusively locked.
185 break a lock that is held by another process.
189 successfully acquires the lock, it returns the exit status produced by
194 .Bl -tag -width ".Dv EX_CANTCREAT"
196 The specified lock file was already locked by another process.
201 was unable to create the lock file, e.g., because of insufficient access
206 option is specified and the specified lock file does not exist.
222 The first job takes a lock and sleeps for 5 seconds in the background.
223 The second job tries to get the lock and timeouts after 1 second (PID numbers
225 .Bd -literal -offset indent
226 $ lockf mylock sleep 5 & lockf -t 1 mylock echo "Success"
231 The first job takes a lock and sleeps for 1 second in the background.
232 The second job waits up to 5 seconds to take the lock and echoes the message on
234 .Bd -literal -offset indent
235 $ lockf mylock sleep 1 & lockf -t 5 mylock echo "Success"
240 Lock a file and run a script, return immediately if the lock is not
241 available. Do not delete the file afterward so lock order is
244 .Dl $ lockf -t 0 -k /tmp/my.lock myscript
246 Protect a section of a shell script with a lock, wait up to 5 seconds
248 Note that the shell script has opened the lock file
249 .Fa /tmp/my.lock ,
252 is performing the lock call exclusively via the passed in file descriptor (9).
261 .Pa /tmp/my.lock ,
262 rather than by replacing the lock file.
263 .Bd -literal -offset indent
265 lockf -s -t 5 9
266 if [ $? -ne 0 ]; then
267 echo "Failed to obtain lock"
274 ) 9>/tmp/my.lock