![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2005 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: vlRdWrLock__rti__.h,v $ $Revision: 1.3 $ $State: Exp $ 00007 *******************************************************************************/ 00010 00011 #ifndef VXWORKS 00012 00013 #ifndef vlRdWrLock__rti___H_ 00014 #define vlRdWrLock__rti___H_ 00015 00016 #include "rtiMsConfig.h" 00017 #include <vlutil/vlMachineTypes.h> 00018 00019 #if WIN32 00020 #include <winsock2.h> 00021 #include <process.h> 00022 #else 00023 #include <pthread.h> 00024 #endif 00025 00026 #ifdef DtUSE_UTILITIES_NAMESPACE 00027 namespace DtUSE_UTILITIES_NAMESPACE 00028 { 00029 #endif 00030 00037 class DT_DLL_RTIUTIL DtRdWrLock__rti__ 00038 { 00039 public: 00040 00042 DtRdWrLock__rti__(); 00043 00044 protected: 00045 00047 DtRdWrLock__rti__(const DtRdWrLock__rti__ & orig); 00048 00050 const DtRdWrLock__rti__ & operator=(const DtRdWrLock__rti__ & orig); 00051 00052 public: 00054 virtual ~DtRdWrLock__rti__(); 00055 00057 virtual void init(); 00058 00060 virtual void destroy(); 00061 00063 virtual int wrLock(); 00064 00066 virtual int rdLock(); 00067 00070 virtual int wrUnlock(); 00071 00074 virtual int rdUnlock(); 00075 00076 protected: 00077 00090 volatile long readers; 00091 volatile long writers; 00092 00093 #ifndef WIN32 00094 pthread_rwlock_t myPtLock; 00095 pthread_rwlock_t * myLock; 00096 #endif //! WIN32 00097 00098 }; 00099 00100 #ifdef DtUSE_UTILITIES_NAMESPACE 00101 } 00102 #endif 00103 00104 #endif //! vlRdWrLock__rti___H_ 00105 00106 #endif //! VXWORKS