From 30348d5f7e4e4a1b035bc8ebbfa6b1e789a79375 Mon Sep 17 00:00:00 2001 From: comex Date: Fri, 17 Jul 2015 18:00:26 -0400 Subject: race condition fix --- darwin-bootstrap/posixspawn-hook.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'darwin-bootstrap/posixspawn-hook.c') diff --git a/darwin-bootstrap/posixspawn-hook.c b/darwin-bootstrap/posixspawn-hook.c index 47e792c..9826170 100644 --- a/darwin-bootstrap/posixspawn-hook.c +++ b/darwin-bootstrap/posixspawn-hook.c @@ -489,7 +489,6 @@ static int hook_xpc_pipe_try_receive(mach_port_t port_set, xxpc_object_t *reques pthread_mutex_lock(&g_state_lock); xxpc_object_t fate = xxpc_dictionary_get_value(g_bundleid_to_fate, bundleid); - pthread_mutex_unlock(&g_state_lock); if (fate) { if (IB_VERBOSE) { char *desc = xxpc_copy_description(fate); @@ -501,6 +500,7 @@ static int hook_xpc_pipe_try_receive(mach_port_t port_set, xxpc_object_t *reques if (IB_VERBOSE) ib_log("your (%s) fate is unavailable", bundleid); } + pthread_mutex_unlock(&g_state_lock); xxpc_dictionary_set_value(reply, "out", out); xxpc_release(out); } else { -- cgit v1.2.3