ACE_File_Lock Class ReferenceA wrapper around the UNIX file locking mechanism. More...
Collaboration diagram for ACE_File_Lock:
![]()
Detailed DescriptionA wrapper around the UNIX file locking mechanism.Allows us to "adapt" the UNIX file locking mechanisms to work with all of our Guard stuff... Constructor & Destructor Documentation
Set the <handle_> of the File_Lock to handle. Note that this constructor assumes ownership of the handle and will close it down in <remove>. If you want the handle to stay open when <remove> is called make sure to call <dup> on the handle. If you don't want the file unlinked in the destructor pass a zero value for <unlink_in_destructor>.
Open the filename with flags and mode and set the result to <handle_>. If you don't want the file unlinked in the destructor pass a zero value for <unlink_in_destructor>.
Remove a File lock by releasing it and closing down the <handle_>.
Member Function DocumentationOpen the filename with flags and mode and set the result to <handle_>.
Remove a File lock by releasing it and closing down the <handle_>. If <unlink_file> is non-0 then we unlink the file. Note, for interface uniformity with other synchronization wrappers we include the <acquire> method. This is implemented as a write-lock to be on the safe-side...
Note, for interface uniformity with other synchronization wrappers we include the <tryacquire> method. This is implemented as a write-lock to be on the safe-side... Returns -1 on failure. If we "failed" because someone else already had the lock, Unlock a readers/writer lock.
Acquire a write lock, but block if any readers or a writer hold the lock.
Conditionally acquire a write lock (i.e., won't block). Returns -1 on failure. If we "failed" because someone else already had the lock,
Conditionally upgrade to a write lock (i.e., won't block). Returns -1 on failure. If we "failed" because someone else already had the lock,
Acquire a read lock, but block if a writer hold the lock. Returns -1 on failure. If we "failed" because someone else already had the lock,
Conditionally acquire a read lock (i.e., won't block). Returns -1 on failure. If we "failed" because someone else already had the lock,
Get underlying ACE_HANDLE for the file.
Set underlying ACE_HANDLE. Note that this method assumes ownership of the <handle> and will close it down in <remove>. If you want the <handle> to stay open when <remove> is called make sure to call <dup> on the <handle> before closing it. You are responsible for the closing the existing <handle> before overwriting it.
Dump state of the object.
Member Data DocumentationDeclare the dynamic allocation hooks.
Locking structure for OS record locks.
Keeps track of whether <remove> has been called yet to avoid multiple <remove> calls, e.g., explicitly and implicitly in the destructor. This flag isn't protected by a lock, so make sure that you don't have multiple threads simultaneously calling <remove> on the same object, which is a bad idea anyway...
Keeps track of whether to unlink the underlying file in the destructor.
The documentation for this class was generated from the following files: Generated on Mon Sep 15 07:15:01 2008 for ACE by ![]() |