00001 #ifndef _XROOTD_FILELOCK1_H_ 00002 #define _XROOTD_FILELOCK1_H_ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d X r o o t d F i l e L o c k 1 . h h */ 00006 /* */ 00007 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved. See XrdInfo.cc for complete License Terms */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC03-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id: XrdXrootdFileLock1.hh 22437 2008-03-04 14:35:16Z rdm $ 00014 00015 #include "XrdSys/XrdSysPthread.hh" 00016 #include "XrdXrootd/XrdXrootdFile.hh" 00017 #include "XrdXrootd/XrdXrootdFileLock.hh" 00018 00019 // This class implements a single server per host lock manager by simply using 00020 // an in-memory hash table to keep track of file locks. 00021 // 00022 class XrdXrootdFileLock1 : XrdXrootdFileLock 00023 { 00024 public: 00025 00026 int Lock(XrdXrootdFile *fp, int force=0); 00027 00028 void numLocks(XrdXrootdFile *fp, int &rcnt, int &wcnt); 00029 00030 int Unlock(XrdXrootdFile *fp); 00031 00032 XrdXrootdFileLock1() {} 00033 ~XrdXrootdFileLock1() {} // This object is never destroyed! 00034 private: 00035 static const char *TraceID; 00036 static XrdSysMutex LTMutex; 00037 }; 00038 #endif