!18633 [LITE][IOS] fix compile mindrt threadpool
Merge pull request !18633 from yefeng/126-fix_ios_compile
This commit is contained in:
commit
e2494379f6
|
@ -24,8 +24,10 @@ void ActorWorker::CreateThread(ActorThreadPool *pool) {
|
|||
}
|
||||
|
||||
void ActorWorker::Run() {
|
||||
#ifndef __APPLE__
|
||||
static std::atomic_int index = 0;
|
||||
pthread_setname_np(pthread_self(), ("ActorThread_" + std::to_string(index++)).c_str());
|
||||
#endif
|
||||
while (alive_) {
|
||||
// only run either local KernelTask or PoolQueue ActorTask
|
||||
#ifdef ENABLE_MINDRT
|
||||
|
|
|
@ -32,8 +32,10 @@ Worker::~Worker() {
|
|||
void Worker::CreateThread() { thread_ = std::thread(&Worker::Run, this); }
|
||||
|
||||
void Worker::Run() {
|
||||
#ifndef __APPLE__
|
||||
static std::atomic_int index = 0;
|
||||
pthread_setname_np(pthread_self(), ("KernelThread_" + std::to_string(index++)).c_str());
|
||||
#endif
|
||||
while (alive_) {
|
||||
if (RunLocalKernelTask()) {
|
||||
spin_count_ = 0;
|
||||
|
|
Loading…
Reference in New Issue