7 #ifndef NT_SYNCHRONIZED_H
8 #define NT_SYNCHRONIZED_H
10 #define NT_CRITICAL_REGION(s) { NTSynchronized _sync(s);
11 #define NT_END_REGION }
13 #if (defined __vxworks || defined WIN32)
24 m_semaphore = semMCreate(SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE);
27 semDelete(m_semaphore);
30 semTake(m_semaphore, WAIT_FOREVER);
47 pthread_mutexattr_init(&mta);
48 pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_RECURSIVE);
49 pthread_mutex_init(&m_semaphore, &mta);
52 pthread_mutex_unlock(&m_semaphore);
53 pthread_mutex_destroy(&m_semaphore);
56 pthread_mutex_lock(&m_semaphore);
59 pthread_mutex_unlock(&m_semaphore);
62 pthread_mutexattr_t mta;
63 pthread_mutex_t m_semaphore;
82 #if (defined __vxworks || defined WIN32)
87 #if (defined __vxworks || defined WIN32)
virtual ~NTSynchronized()
NTSynchronized(NTReentrantSemaphore &)