From 9e8dec188d55ca1f0a3b33acab702ced8ed07a18 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 5 Nov 2017 00:09:50 +0100 Subject: Work on changing style, and an important typo fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-server/signals.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'src/mds-server/signals.c') diff --git a/src/mds-server/signals.c b/src/mds-server/signals.c index 8e4dc0e..8e1ce1d 100644 --- a/src/mds-server/signals.c +++ b/src/mds-server/signals.c @@ -32,21 +32,20 @@ */ void signal_all(int signo) { - pthread_t current_thread; - ssize_t node; - - current_thread = pthread_self(); - - if (pthread_equal(current_thread, master_thread) == 0) - pthread_kill(master_thread, signo); - - with_mutex (slave_mutex, - foreach_linked_list_node (client_list, node) - { - client_t* value = (client_t*)(void*)(client_list.values[node]); - if (pthread_equal(current_thread, value->thread) == 0) - pthread_kill(value->thread, signo); - } - ); -} + pthread_t current_thread; + ssize_t node; + client_t *value; + + current_thread = pthread_self(); + if (pthread_equal(current_thread, master_thread) == 0) + pthread_kill(master_thread, signo); + + with_mutex (slave_mutex, + foreach_linked_list_node (client_list, node) { + value = (client_t*)(void*)(client_list.values[node]); + if (!pthread_equal(current_thread, value->thread)) + pthread_kill(value->thread, signo); + } + ); +} -- cgit v1.2.3-70-g09d2