摘要:
1)首先定义互斥对象的接口IMutex(所在文件是IMutex.h)class IMutex //抽象接口{public: virtual ~IMutex() {} virtual void Lock() const = 0; virtual void Unlock() const = 0;};2)接着是实现IMutex接口的实现类Mutex头文件是Mutex.h:#ifndef _WIN32#include <pthread.h>#else#include <windows.h>#endif#include "IMutex.h"class Mute 阅读全文