summaryrefslogtreecommitdiffstats
path: root/socket_wrapper-config.cmake.in
diff options
context:
space:
mode:
authorAnoop C S <anoopcs@redhat.com>2018-06-10 13:19:14 +0530
committerAndreas Schneider <asn@samba.org>2018-06-14 11:05:17 +0200
commit5529ba060519017bb71de5de6e7b81e5b3d56ccf (patch)
treede8dceef2b2fdd372617e49f222426825eafbf07 /socket_wrapper-config.cmake.in
parent321833e2696f1964eef6ff1bfa2455da735a372a (diff)
downloadsocket_wrapper-5529ba060519017bb71de5de6e7b81e5b3d56ccf.tar.gz
socket_wrapper-5529ba060519017bb71de5de6e7b81e5b3d56ccf.tar.xz
socket_wrapper-5529ba060519017bb71de5de6e7b81e5b3d56ccf.zip
swrap: Replace socket_fds linked list with an array
This fixes the following bug: As we are using a doubly linked list, we need a mutex which needs to be locked when we are reading it that we do not end up with invalid pointers. The following can happen: We are in swrap_close() which calls find_socket_info_fd() this locks the mutex for the linked list. Now we get a singal SIGCHILD and the signal handler is called. The signal handler calls swrap_write() and we try to find out if the socket is managed by socket_wrapper calling find_socket_info_fd() again -> DEADLOCK! By moving to an array to handle the socket fds and using the fd as the array access, we do not need a mutex for reading anymore. All we need is a memory barrier. This change also improves the performance as we move from the a linked list to a hash table! Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Anoop C S <anoopcs@redhat.com> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'socket_wrapper-config.cmake.in')
0 files changed, 0 insertions, 0 deletions