/******************************************
: 适用于多线程的类的设计方法
* (特别适合构造基础数据类型)
*ps. 参考了ACE的基础类
******************************************/
class Multi-Thread-template-Base{
public:
/* interface with lock */
Interface();
protected:
/**********************************
* interface without lock
* derive class can overload methods
* showed below.
**********************************/
interface_i();
private:
/* multi-thread control */
Mutex_Type lock_;
//...
};
阅读(1177) | 评论(0) | 转发(0) |