in reply to Fork + Flock = Who Gets the Lock?
Locks created by flock() are associated with a file, or, more precisely, an open file table entry. This means that duplicate file descriptors (created by, for example, fork(2) or dup(2)) refer to the same lock, and this lock may be modified or released using any of these descriptors. Furthermore, the lock is released either by an explicit LOCK_UN operation on any of these duplicate descriptors, or when all such descriptors have been closed.
... so they are shared!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Fork + Flock = Who Gets the Lock?
by Anonymous Monk on Jun 03, 2005 at 19:59 UTC | |
by ikegami (Patriarch) on Jun 03, 2005 at 20:01 UTC | |
by salva (Canon) on Jun 03, 2005 at 20:01 UTC | |
by Anonymous Monk on Aug 30, 2013 at 06:36 UTC |