mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-11-29 18:37:41 +08:00
chang old vc project
This commit is contained in:
parent
858bcc7a94
commit
49f0ad6c1f
@ -19,6 +19,13 @@ public:
|
||||
* @return {void*} 线程退出前返回的参数
|
||||
*/
|
||||
virtual void* run(void) = 0;
|
||||
|
||||
/**
|
||||
* 虚方法,在新创建的子线程中的 run() 方法被调用前调用,在同步创建
|
||||
* 线程方式下,子线程被创建后调用该虚方法,然后再通知创建这线程,
|
||||
* 从而保证在创建线程的 start() 方法返回前子线程执行初始化过程。
|
||||
*/
|
||||
virtual void init(void) {}
|
||||
};
|
||||
|
||||
template<typename T> class tbox;
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource_vc2015.h\0"
|
||||
"resource_vc2017.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
|
@ -87,6 +87,9 @@ void* thread::thread_run(void* arg)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
thr->init();
|
||||
|
||||
thr->sync_->push(NULL);
|
||||
|
||||
// 如果线程创建时为分离模式,则当 run 运行时用户有可能
|
||||
|
Loading…
Reference in New Issue
Block a user