mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-26 05:50:23 +00:00
Fix small race potential
This commit is contained in:
1 parent
bc2f2de6c2
commit
a46fb7ba36
1 file changed
+3
-2
@@ -48,12 +48,13 @@ public class ComputerManagerService extends Service {
|
|||||||
private ServiceConnection discoveryServiceConnection = new ServiceConnection() {
|
private ServiceConnection discoveryServiceConnection = new ServiceConnection() {
|
||||||
public void onServiceConnected(ComponentName className, IBinder binder) {
|
public void onServiceConnected(ComponentName className, IBinder binder) {
|
||||||
synchronized (discoveryServiceConnection) {
|
synchronized (discoveryServiceConnection) {
|
||||||
discoveryBinder = ((DiscoveryService.DiscoveryBinder)binder);
|
DiscoveryService.DiscoveryBinder privateBinder = ((DiscoveryService.DiscoveryBinder)binder);
|
||||||
|
|
||||||
// Set us as the event listener
|
// Set us as the event listener
|
||||||
discoveryBinder.setListener(createDiscoveryListener());
|
privateBinder.setListener(createDiscoveryListener());
|
||||||
|
|
||||||
// Signal a possible waiter that we're all setup
|
// Signal a possible waiter that we're all setup
|
||||||
|
discoveryBinder = privateBinder;
|
||||||
discoveryServiceConnection.notifyAll();
|
discoveryServiceConnection.notifyAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user