29 #ifndef GENAPI_GCSYNCH_H 30 #define GENAPI_GCSYNCH_H 38 #elif defined (__GNUC__) && (defined (__linux__) || defined (__APPLE__)) 39 # include <semaphore.h> 43 #elif defined(VXWORKS) 47 # error No/unknown platform thread support 89 CRITICAL_SECTION m_csObject;
91 #elif defined (__GNUC__) && (defined (__linux__) || defined (__APPLE__)) 92 pthread_mutex_t m_mtxObject;
94 #elif defined(VXWORKS) 97 # error No/unknown platform thread support 110 # if defined (_WIN32) 113 int64_t GetLockCount();
116 int64_t GetRecursionCount();
118 # elif defined (__GNUC__) && (defined (__linux__) || defined (__APPLE__) || defined(VXWORKS)) 121 # error No/unknown platform support 141 AutoLock(
CLock& lock)
153 AutoLock& operator=(
const AutoLock&);
154 AutoLock(
const AutoLock&);
166 template<
class Object>
170 mutable CLock m_Lock;
185 m_Object.m_Lock.Lock();
189 m_Object.m_Lock.Unlock();
198 return Lock( *
this );
215 #if defined(_WIN32) && ! defined(PHARLAP_WIN32) 232 bool IsValid(
void)
const;
235 bool Lock(
unsigned int timeout_ms);
243 #if defined (__GNUC__) && (defined (__linux__) || defined (__APPLE__)) 251 #elif defined (__GNUC__) && (defined (__linux__) || defined (__APPLE__)) 258 # error No/unknown platform thread support 264 mutable long m_DebugCount;
322 #endif // GENAPI_GCSYNCH_H Instance-Lock for an object.
Definition: GCSynch.h:167
unlocks the global lock object on destruction
Definition: GCSynch.h:286
void UnlockEarly(void)
This function allows to unlock the object early before the object is destroyed.
Definition: GCSynch.h:306
void Unlock(void)
leaves the lock
void Lock()
enters the critical section (may block)
Definition: GCSynch.h:106
Named global lock which can be used over process boundaries.
Definition: GCSynch.h:207
A lock class.
Definition: GCSynch.h:61
Definition: GCSynch.h:179
Lock GetLock() const
Get a new lock.
Definition: GCSynch.h:196
Standard GenICam Exceptions.
A string class which is a clone of std::string.
Definition: GCString.h:50
void Unlock()
leaves the critical section
Platform-dependent type definitions.