mirror of
https://github.com/outbackdingo/parodus.git
synced 2026-01-27 10:20:04 +00:00
fix deadlock in wait_while_interface_down
This commit is contained in:
@@ -641,18 +641,17 @@ int wait_while_interface_down()
|
||||
close_and_unref_connection (get_global_conn());
|
||||
set_global_conn(NULL);
|
||||
|
||||
pthread_mutex_lock(get_interface_down_mut());
|
||||
while (!get_interface_down_event ()) {
|
||||
pthread_mutex_lock(get_interface_down_mut());
|
||||
rtn = pthread_cond_wait(get_interface_down_con(), get_interface_down_mut());
|
||||
pthread_mutex_unlock (get_interface_down_mut());
|
||||
if (rtn != 0)
|
||||
ParodusError
|
||||
("Error on pthread_cond_wait (%d) in wait_while_interface_down\n", rtn);
|
||||
if ((rtn != 0) || g_shutdown) {
|
||||
pthread_mutex_unlock (get_interface_down_mut());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock (get_interface_down_mut());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user