Poster of Linux kernelThe best gift for a Linux geek
ost::ThreadLock

ost::ThreadLock

Section: C Library Functions (3) Updated: 16 Feb 2010
Local index Up
 

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>  

Public Member Functions


ThreadLock ()
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.  

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.

 

Constructor & Destructor Documentation

 

ost::ThreadLock::ThreadLock ()

Create a process shared thread lock object.  

virtual ost::ThreadLock::~ThreadLock () [virtual]

Destroy a process shared thread lock object.  

Member Function Documentation

 

void ost::ThreadLock::readLock (void)

Aquire a read lock for the current object.  

bool ost::ThreadLock::tryReadLock (void)

Attempt read lock for current object. Returns:

true on success.

 

bool ost::ThreadLock::tryWriteLock (void)

Attempt write lock for current object. Returns:

true on success.

 

void ost::ThreadLock::unlock (void)

Release any held locks.  

void ost::ThreadLock::writeLock (void)

Aquire a write lock for the current object.

 

Author

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


 

Index

NAME
SYNOPSIS
Public Member Functions
Detailed Description
Constructor & Destructor Documentation
ost::ThreadLock::ThreadLock ()
virtual ost::ThreadLock::~ThreadLock () [virtual]
Member Function Documentation
void ost::ThreadLock::readLock (void)
bool ost::ThreadLock::tryReadLock (void)
bool ost::ThreadLock::tryWriteLock (void)
void ost::ThreadLock::unlock (void)
void ost::ThreadLock::writeLock (void)
Author

This document was created by man2html, using the manual pages.
Time: 21:51:52 GMT, April 16, 2011