fix: optimize judging comdition

Signed-off-by: jwx1282937 <jialinbo@huawei.com>
This commit is contained in:
jwx1282937 2023-11-06 02:25:53 +00:00
parent c101e3f0c9
commit 868b42d23f

View File

@ -66,7 +66,8 @@ static void ThreadContextDestructor(int32_t proto)
pthread_mutex_lock(&threadPool->lock);
if (proto == IF_PROT_BINDER) {
++threadPool->idleThreadNum;
} else if (proto == IF_PROT_DATABUS) {
}
if (proto == IF_PROT_DATABUS) {
++threadPool->idleSocketThreadNum;
}
pthread_mutex_unlock(&threadPool->lock);
@ -174,7 +175,8 @@ int32_t SpawnNewThread(ThreadPool *threadPool, int32_t policy, int32_t proto)
pthread_detach(threadId);
if (proto == IF_PROT_BINDER) {
--threadPool->idleThreadNum;
} else if (proto == IF_PROT_DATABUS) {
}
if (proto == IF_PROT_DATABUS) {
--threadPool->idleSocketThreadNum;
}
pthread_mutex_unlock(&threadPool->lock);