Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TPosixMutex.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/thread:$Id$
0002 // Author: Fons Rademakers   25/06/97
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TPosixMutex
0013 #define ROOT_TPosixMutex
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TPosixMutex                                                          //
0019 //                                                                      //
0020 // This class provides an interface to the posix mutex routines.        //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TMutexImp.h"
0025 
0026 #include <pthread.h>
0027 
0028 class TPosixMutex : public TMutexImp {
0029 
0030 friend class TPosixCondition;
0031 
0032 private:
0033    pthread_mutex_t  fMutex;   // the pthread mutex
0034 
0035    constexpr static int kIsRecursive = BIT(14);
0036 
0037 public:
0038    TPosixMutex(Bool_t recursive=kFALSE);
0039    virtual ~TPosixMutex();
0040 
0041    Int_t  Lock() override;
0042    Int_t  UnLock() override;
0043    Int_t  TryLock() override;
0044 
0045    ClassDefOverride(TPosixMutex,0)  // Posix mutex lock
0046 };
0047 
0048 #endif