Closed softins closed 6 years ago
It appears that the on_connection_ready() hook is called from within nopoll_conn_complete_handshake() with the connection mutex held:
on_connection_ready()
nopoll_conn_complete_handshake()
/* acquire here handshake mutex */ nopoll_mutex_lock (conn->ref_mutex); /* complete handshake */ nopoll_conn_complete_handshake (conn); /* release here handshake mutex */ nopoll_mutex_unlock (conn->ref_mutex);
The above code appears in two places: nopoll_conn_is_ready() and nopoll_conn_get_msg().
nopoll_conn_is_ready()
nopoll_conn_get_msg()
This means that it is impossible to call nopoll_conn_ref() within on_connection_ready(), due to deadlock.
nopoll_conn_ref()
Should there be a separate handshake_mutex, different from the ref_mutex?
handshake_mutex
ref_mutex
It appears that the
on_connection_ready()
hook is called from withinnopoll_conn_complete_handshake()
with the connection mutex held:The above code appears in two places:
nopoll_conn_is_ready()
andnopoll_conn_get_msg()
.This means that it is impossible to call
nopoll_conn_ref()
withinon_connection_ready()
, due to deadlock.Should there be a separate
handshake_mutex
, different from theref_mutex
?