Prevent race condition when closing/reopening message receiver.
This commit is contained in:
parent
ac0216d916
commit
eda2b87a57
2 changed files with 2 additions and 8 deletions
|
@ -184,12 +184,6 @@ public class ApplicationDependencies {
|
|||
}
|
||||
|
||||
public static @NonNull SignalServiceMessageReceiver getSignalServiceMessageReceiver() {
|
||||
SignalServiceMessageReceiver local = messageReceiver;
|
||||
|
||||
if (local != null) {
|
||||
return local;
|
||||
}
|
||||
|
||||
synchronized (LOCK) {
|
||||
if (messageReceiver == null) {
|
||||
messageReceiver = provider.provideSignalServiceMessageReceiver();
|
||||
|
|
|
@ -48,8 +48,8 @@ public class IncomingMessageObserver {
|
|||
|
||||
private static final AtomicInteger INSTANCE_COUNT = new AtomicInteger(0);
|
||||
|
||||
private static SignalServiceMessagePipe pipe = null;
|
||||
private static SignalServiceMessagePipe unidentifiedPipe = null;
|
||||
private static volatile SignalServiceMessagePipe pipe = null;
|
||||
private static volatile SignalServiceMessagePipe unidentifiedPipe = null;
|
||||
|
||||
private final Application context;
|
||||
private final SignalServiceNetworkAccess networkAccess;
|
||||
|
|
Loading…
Add table
Reference in a new issue