fixed WHOHandler.c multithread compatibility
[NeonServV5.git] / src / ClientSocket.c
index 83a2e281c8bf8bf91a4cdc6edbbd0dfde6223954..80f4c37d2cae7f73fa4cdd4b996858bfa528d551 100644 (file)
@@ -445,9 +445,11 @@ void socket_loop(int timeout_seconds) {
                     sock->bufferpos -= used;
                 }
                 is_synchronized = 0;
+                unsigned long tid = syscall(SYS_gettid);
+                whohandler_start_of_recv(sock, tid);
                 DESYNCHRONIZE(synchronized_recv);
                 parse_lines(sock, linesbuf, used);
-                whohandler_end_of_recv(sock); //WHOHandler hack (unlock WHOQueue mutexes)
+                whohandler_end_of_recv(sock, tid); //WHOHandler hack (unlock WHOQueue mutexes)
                 #else
                 int used = parse_lines(sock, sock->buffer, sock->bufferpos);
                 if(used == sock->bufferpos + 1) {