11 #ifndef MI_BASE_CONDITION_H
12 #define MI_BASE_CONDITION_H
16 #ifndef MI_PLATFORM_WINDOWS
19 #include <mi/base/miwindows.h>
37 #ifndef MI_PLATFORM_WINDOWS
39 pthread_mutex_init(&m_mutex,NULL);
40 pthread_cond_init(&m_condvar,NULL);
42 m_handle = CreateEvent(NULL,
false,
false, NULL);
49 #ifndef MI_PLATFORM_WINDOWS
50 pthread_mutex_destroy(&m_mutex);
51 pthread_cond_destroy(&m_condvar);
53 CloseHandle(m_handle);
62 #ifndef MI_PLATFORM_WINDOWS
63 pthread_mutex_lock(&m_mutex);
65 pthread_cond_wait(&m_condvar,&m_mutex);
67 pthread_mutex_unlock(&m_mutex);
69 WaitForSingleObject(m_handle, INFINITE);
83 #ifndef MI_PLATFORM_WINDOWS
84 pthread_mutex_lock(&m_mutex);
86 pthread_cond_signal(&m_condvar);
87 pthread_mutex_unlock(&m_mutex);
94 #ifndef MI_PLATFORM_WINDOWS
95 pthread_mutex_t m_mutex;
98 pthread_cond_t m_condvar;
113 #endif // MI_BASE_CONDITION_H