From 3189551ee6da0793bfda1f72467aa21410c880ff Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Mon, 2 Sep 2013 12:56:36 +0000 Subject: [PATCH] Fixing deadlock in SOCKET_process_end git-svn-id: svn://kolibrios.org@3884 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/network/socket.inc | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/kernel/trunk/network/socket.inc b/kernel/trunk/network/socket.inc index 8d33cd6697..a5db19dad5 100644 --- a/kernel/trunk/network/socket.inc +++ b/kernel/trunk/network/socket.inc @@ -2051,6 +2051,7 @@ SOCKET_alloc: ; SOCKET_free ; ; Free socket data memory and remove socket from the list +; Caller should lock and unlock socket_mutex ; ; IN: eax = socket ptr ; OUT: / @@ -2061,11 +2062,6 @@ SOCKET_free: DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: %x\n", eax - pusha - mov ecx, socket_mutex - call mutex_lock - popa - call SOCKET_check jz .error @@ -2111,12 +2107,6 @@ SOCKET_free: DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: success!\n" .error: - - pusha - mov ecx, socket_mutex - call mutex_unlock - popa - ret ;------------------------------------ @@ -2331,9 +2321,6 @@ SOCKET_check_owner: align 4 SOCKET_process_end: - pushf - cli ; FIXME - DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_process_end: %x\n", edx pusha @@ -2359,11 +2346,6 @@ SOCKET_process_end: mov eax, ebx mov ebx, [ebx + SOCKET.NextPtr] - pusha - mov ecx, socket_mutex - call mutex_unlock - popa - pusha cmp [eax + SOCKET.Domain], AF_INET4 jne .free @@ -2379,12 +2361,6 @@ SOCKET_process_end: .closed: popa - - pusha - mov ecx, socket_mutex - call mutex_lock - popa - jmp .next_socket_test .done: @@ -2395,8 +2371,6 @@ SOCKET_process_end: call mutex_unlock popa - popf - ret