You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Barrier is called with no active asynchronous subscriptions, the call will be made synchronously with both nc.mu and nc.subsMu held. Calling any other method on the Conn in the callback will than block the whole connection.
@nussjustin Thanks again for an excellent report (and catch!). I had originally started f as a go-routine but decided at the last minute that there was no need really. However, you are right, in this case I should have released the locks. The PR #346 addresses that. Thanks!
When
Barrier
is called with no active asynchronous subscriptions, the call will be made synchronously with bothnc.mu
andnc.subsMu
held. Calling any other method on theConn
in the callback will than block the whole connection.E.g. calling
will block since the callback is called synchronously in
Barrier
, which holds the two mutexes.As long as there is at least one asynchronous subscription, the callback will be called later without any mutex held. So this will work:
The text was updated successfully, but these errors were encountered: