Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   Related Pages  

wefts_rrwmutex.h

Go to the documentation of this file.
00001 /*
00002    wefts_rrwmutex.h
00003    Read/write Reentrant/advanced Mutex object header file.
00004 
00005    $Id: wefts_rrwmutex.h,v 1.7 2003/08/17 01:15:19 jonnymind Exp $
00006 ---------------------------------------------
00007    Begin      : 2003-08-02 20:58
00008    Author     : Giancarlo Niccolai
00009 
00010    Last modified because:
00011 
00012 */
00013 
00014 /**************************************************************************
00015 *   This program is free software; you can redistribute it and/or modify  *
00016 *   it under the terms of the GNU Library General Public License as       *
00017 *   published by the Free Software Foundation; either version 2.1 of the  *
00018 *   License, or (at your option) any later version.                       *
00019 ***************************************************************************/
00020 
00021 
00022 #ifndef WT_RRWMUTEX_H
00023 #define WT_RRWMUTEX_H
00024 
00025 #include <wefts_rwmutex.h>
00026 #ifndef NO_ASSERTIONS
00027 #include <cassert>
00028 #endif
00029 
00030 namespace Wefts {
00031 
00058 class RRWMutex: public RWMutex  {
00059 private:
00060    int m_fence;
00061    OSThread m_owner;
00062 
00063 public:
00065    RRWMutex(): RWMutex() {
00066       m_fence = 0;
00067    }
00068 
00069 
00090    virtual bool lockRead( double seconds=0.0 );
00091 
00095    virtual bool tryLockRead();
00096 
00110    virtual bool promote( bool fence ) throw( InvalidError )
00111       { return promote( 0.0, fence ); }
00112 
00120    virtual bool inline promote( double time = 0.0, bool fence= false )
00121             throw( InvalidError );
00122 
00132    virtual bool lockWrite( bool fence ) { return lockWrite( 0.0, fence ); }
00133 
00140    virtual bool lockWrite( double time =0.0, bool fence = false);
00141 
00148    virtual void unlock() throw( InvalidError );
00149 
00150    virtual void handleCleanup( int code );
00151 };
00152 
00153 }
00154 
00155 #endif
00156 /* end of wefts_rrwmutex.h */

Generated on Mon Aug 18 05:53:37 2003 for Wefts by doxygen1.2.18