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
Impls of ManagedClientTransport.Listener "do not need to be thread-safe so notifications must be properly synchronized externally." BinderClientTransport mostly seems to achieve this by holding its "this" lock, except for unregisterInbound() which makes a naked call to transportInUse(false).
The use of AtomicInteger numInUseStreams is questionable here too: an unregisterInbound() call could cause that counter to go to zero and that thread could decide to invoke transportInUse(false). Before it can do so, a newStream() call could cause numInUseStreams to go positive and that thread could decide to call transportInUse(true). These two threads would now race and if the false one wins, the Listener's idea of in use would become out of sync with reality.
The text was updated successfully, but these errors were encountered:
Impls of ManagedClientTransport.Listener "do not need to be thread-safe so notifications must be properly synchronized externally." BinderClientTransport mostly seems to achieve this by holding its "this" lock, except for
unregisterInbound()
which makes a naked call totransportInUse(false)
.The use of
AtomicInteger numInUseStreams
is questionable here too: an unregisterInbound() call could cause that counter to go to zero and that thread could decide to invoketransportInUse(false)
. Before it can do so, a newStream() call could cause numInUseStreams to go positive and that thread could decide to calltransportInUse(true)
. These two threads would now race and if thefalse
one wins, the Listener's idea of in use would become out of sync with reality.The text was updated successfully, but these errors were encountered: