logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

ost::ThreadLock - The ThreadLock class impliments a thread rwlock for optimal reader performance on

Author

       Generated automatically by Doxygen for GNU CommonC++ from the source code.

GNU CommonC++                                    Sun Dec 27 2020                              ost::ThreadLock(3)

Constructor & Destructor Documentation

ost::ThreadLock::ThreadLock()
       Create a process shared thread lock object.

   virtualost::ThreadLock::~ThreadLock()[virtual]
       Destroy a process shared thread lock object.

Detailed Description

       The ThreadLock class impliments a thread rwlock for optimal reader performance on systems which have
       rwlock support, and reverts to a simple mutex for those that do not.

       Author
           David Sugar dyfet@ostel.com

       Posix rwlock extension for protected access.

Member Function Documentation

voidost::ThreadLock::readLock(void)
       Aquire a read lock for the current object.

       Referenced by ost::ReadLock::ReadLock().

   boolost::ThreadLock::tryReadLock(void)
       Attempt read lock for current object.

       Returns
           true on success.

   boolost::ThreadLock::tryWriteLock(void)
       Attempt write lock for current object.

       Returns
           true on success.

   voidost::ThreadLock::unlock(void)
       Release any held locks.

       Referenced by ost::ReadLock::~ReadLock(), and ost::WriteLock::~WriteLock().

   voidost::ThreadLock::writeLock(void)
       Aquire a write lock for the current object.

       Referenced by ost::WriteLock::WriteLock().

Name

       ost::ThreadLock - The ThreadLock class impliments a thread rwlock for optimal reader performance on
       systems which have rwlock support, and reverts to a simple mutex for those that do not.

Synopsis

       #include <thread.h>

   PublicMemberFunctionsThreadLock ()
           Create a process shared thread lock object.
       virtual ~ThreadLock ()
           Destroy a process shared thread lock object.
       void readLock (void)
           Aquire a read lock for the current object.
       void writeLock (void)
           Aquire a write lock for the current object.
       bool tryReadLock (void)
           Attempt read lock for current object.
       bool tryWriteLock (void)
           Attempt write lock for current object.
       void unlock (void)
           Release any held locks.

See Also