| 7363 | } |
| 7364 | |
| 7365 | void *workerThreadMain(void *parg) |
| 7366 | { |
| 7367 | int iel = (int)((int64_t)parg); |
| 7368 | serverLog(LL_NOTICE, "Thread %d alive.", iel); |
| 7369 | serverTL = g_pserver->rgthreadvar+iel; // set the TLS threadsafe global |
| 7370 | tlsInitThread(); |
| 7371 | |
| 7372 | if (iel != IDX_EVENT_LOOP_MAIN) |
| 7373 | { |
| 7374 | aeThreadOnline(); |
| 7375 | aeAcquireLock(); |
| 7376 | initNetworkingThread(iel, cserver.cthreads > 1); |
| 7377 | aeReleaseLock(); |
| 7378 | aeThreadOffline(); |
| 7379 | } |
| 7380 | |
| 7381 | moduleAcquireGIL(true); // Normally afterSleep acquires this, but that won't be called on the first run |
| 7382 | aeThreadOnline(); |
| 7383 | aeEventLoop *el = g_pserver->rgthreadvar[iel].el; |
| 7384 | try |
| 7385 | { |
| 7386 | aeMain(el); |
| 7387 | } |
| 7388 | catch (ShutdownException) |
| 7389 | { |
| 7390 | } |
| 7391 | aeThreadOffline(); |
| 7392 | moduleReleaseGIL(true); |
| 7393 | serverAssert(!GlobalLocksAcquired()); |
| 7394 | aeDeleteEventLoop(el); |
| 7395 | |
| 7396 | tlsCleanupThread(); |
| 7397 | return NULL; |
| 7398 | } |
| 7399 | |
| 7400 | static void validateConfiguration() |
| 7401 | { |
nothing calls this directly
no test coverage detected