Unix and Linux Discussions Tagged with count |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
2 |
5,565 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
7,248 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
5,618 |
UNIX for Beginners Questions & Answers |
|
|
|
14 |
21,948 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
4,026 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,434 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
5,300 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
4,637 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
5,853 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
4,114 |
UNIX for Beginners Questions & Answers |
|
|
|
7 |
5,020 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
2,219 |
UNIX for Beginners Questions & Answers |
|
|
|
14 |
29,090 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
7,751 |
Shell Programming and Scripting |
|
|
|
7 |
3,161 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
1,778 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,737 |
Shell Programming and Scripting |
|
|
|
3 |
3,108 |
AIX |
|
|
|
7 |
2,625 |
Shell Programming and Scripting |
|
|
|
9 |
3,868 |
Shell Programming and Scripting |
|
|
|
3 |
4,584 |
Shell Programming and Scripting |
|
|
|
1 |
3,058 |
Shell Programming and Scripting |
|
|
|
7 |
4,561 |
Programming |
|
|
|
2 |
1,550 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
3,896 |
UNIX for Beginners Questions & Answers |
|
|
|
14 |
4,358 |
Shell Programming and Scripting |
|
|
|
4 |
3,251 |
Shell Programming and Scripting |
|
|
|
3 |
21,272 |
Shell Programming and Scripting |
|
|
|
3 |
11,602 |
Shell Programming and Scripting |
|
|
|
3 |
4,935 |
Shell Programming and Scripting |
|
|
|
6 |
2,738 |
Shell Programming and Scripting |
|
|
|
4 |
6,326 |
UNIX for Dummies Questions & Answers |
|
|
|
6 |
2,583 |
Shell Programming and Scripting |
|
|
|
6 |
2,875 |
UNIX for Dummies Questions & Answers |
|
|
|
14 |
4,485 |
Shell Programming and Scripting |
|
|
|
7 |
17,912 |
Shell Programming and Scripting |
|
|
|
6 |
9,965 |
Shell Programming and Scripting |
|
|
|
6 |
3,237 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
2,215 |
Shell Programming and Scripting |
|
|
|
3 |
2,332 |
Shell Programming and Scripting |
flockfile(3S) flockfile(3S)
NAME
flockfile(), ftrylockfile(), funlockfile() - explicit locking of streams within a multithread application
SYNOPSIS
DESCRIPTION
The and functions provide for explicit application-level locking of streams. These functions can be used by a thread to delineate a
sequence of I/O statements that are to be executed as a unit.
The function is used by a thread to acquire ownership of a object.
The function is used by a thread to acquire ownership of a object if the object is available; is a non-blocking version of
The function is used to relinquish the ownership granted to the thread. The behavior is undefined if a thread other than the current owner
calls the function.
Logically, there is a count associated with each stream. This count is implicitly initialized to zero when the stream is created. The
stream is unlocked when the count is zero. When the count is positive, a single thread owns the stream. When the function is called, if
the count is zero or if the count is positive and the caller owns the stream, the count is incremented. Otherwise, the calling thread is
suspended, waiting for the count to return to zero. Each call to decrements the count. This allows matching calls to (or successful calls
to and to be nested.
All POSIX.1 and C standard functions that reference objects behave as if they use and internally to obtain ownership of these objects.
RETURN VALUE
None for and The function returns zero for success and nonzero to indicate that the lock cannot be acquired.
flockfile(3S)