mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-21 12:03:02 +00:00
Fix small race potential
This commit is contained in:
parent
bc2f2de6c2
commit
a46fb7ba36
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user