Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File 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.8 2003/12/14 09:07:55 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 
00090    virtual bool lockRead( double seconds=0.0 );
00091    
00095    virtual bool tryLockRead();
00096 
00114    virtual bool promoteFence( double time = 0.0, bool fence=true )
00115             throw( InvalidError );
00116 
00126    virtual bool promote( double time = 0.0 )  throw( InvalidError )
00127    {
00128       return promoteFence( time, false );
00129    }
00130      
00131   
00144    virtual bool lockWriteFence( double time =0.0, bool fence = true);
00145 
00152    virtual bool lockWrite( double seconds=0.0 ) { 
00153       return lockWriteFence( seconds, false );
00154    }
00155    
00156 
00175    void degrade() throw( InvalidError );
00176    
00183    virtual void unlock() throw( InvalidError );
00184 
00185    virtual void handleCleanup( int code );
00186 };
00187 
00188 }
00189 
00190 #endif
00191 /* end of wefts_rrwmutex.h */

Generated on Mon Dec 22 04:12:30 2003 for Wefts by doxygen1.2.18