You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
625 B
38 lines
625 B
#ifndef SyncObject_Solaris_h |
|
#define SyncObject_Solaris_h |
|
|
|
#ifndef SyncObject_h |
|
# error include SyncObject.h instead |
|
#endif |
|
|
|
#include <pthread.h> |
|
|
|
namespace act |
|
{ |
|
class SyncObject |
|
{ |
|
private: |
|
SyncObject(const SyncObject&); |
|
SyncObject& operator=(const SyncObject&); |
|
|
|
public: |
|
SyncObject(); |
|
~SyncObject(); |
|
|
|
void lock(); |
|
void unlock(); |
|
|
|
long lockCount() const { return m_lock_count; } |
|
pid_t threadId() const { return m_thread_id; } |
|
|
|
private: |
|
volatile long m_lock_count; |
|
volatile pid_t m_thread_id; |
|
pthread_mutex_t m_sync; |
|
}; |
|
|
|
void Sleep(long msec); |
|
|
|
} // namespace act |
|
|
|
#endif // SyncObject_Solaris_h
|
|
|