diff options
Diffstat (limited to 'vespamalloc')
-rw-r--r-- | vespamalloc/src/vespamalloc/malloc/threadproxy.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vespamalloc/src/vespamalloc/malloc/threadproxy.cpp b/vespamalloc/src/vespamalloc/malloc/threadproxy.cpp index 7a071e87d41..193215ef83d 100644 --- a/vespamalloc/src/vespamalloc/malloc/threadproxy.cpp +++ b/vespamalloc/src/vespamalloc/malloc/threadproxy.cpp @@ -75,11 +75,11 @@ VESPA_DLL_EXPORT int local_pthread_create (pthread_t *thread, void * (*start_routine) (void *), void * arg) { - size_t numThreads; - for (numThreads = _G_threadCount - ;(numThreads < vespamalloc::_G_myMemP->getMaxNumThreads()) && ! _G_threadCount.compare_exchange_strong(numThreads, numThreads+1) - ; numThreads = _G_threadCount) { - } + size_t numThreads = _G_threadCount; + while ((numThreads < vespamalloc::_G_myMemP->getMaxNumThreads()) + && ! _G_threadCount.compare_exchange_strong(numThreads, numThreads+1)) + { } + if (numThreads >= vespamalloc::_G_myMemP->getMaxNumThreads()) { return EAGAIN; } |