use temporal variable to avoid mutex on poll.
@@ -829,9 +829,11 @@ void *pool_main_thread(void *arg)
}
}
- int res = poll(g_fds, g_connections_count, 1000);
+ int connections_count = g_connections_count;
pthread_mutex_unlock(&g_descriptors_mutex);
+ int res = poll(g_fds, connections_count, 1000);
+
if(!res) continue;
// int index = 0;
