📄 thread.h
字号:
#ifndef _THREAD_H#define _THREAD_H#include "types.h"#include <pthread.h>typedef pthread_t threadobj_t;typedef int waittimer_t;class CMutex{private: // Unimplemented CMutex( const CMutex& ); CMutex& operator=( const CMutex& );public: CMutex( void ); virtual ~CMutex( void ); void Lock( void ); void Unlock( void );private: pthread_mutex_t m_mutex;};class CSemaphore{private: // Unimplemented CSemaphore( const CSemaphore& ); CSemaphore& operator=( const CSemaphore& );public: CSemaphore( UINT nCount ); virtual ~CSemaphore( void ); void Lock( void ); void Unlock( void );private: pthread_mutex_t m_mutex; pthread_cond_t m_cond; UINT m_count;};#endif //ndef _THREAD_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -