diff options
Diffstat (limited to 'csharp/src')
-rw-r--r-- | csharp/src/Ice/ACM.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/csharp/src/Ice/ACM.cs b/csharp/src/Ice/ACM.cs index b8af4ddff49..eb262b1e0da 100644 --- a/csharp/src/Ice/ACM.cs +++ b/csharp/src/Ice/ACM.cs @@ -111,8 +111,27 @@ namespace IceInternal { return; } + + if(_connections.Count > 0) + { + // + // Cancel the scheduled timer task and schedule it again now to clear the + // connection set from the timer thread. + // + _instance.timer().cancel(this); + _instance.timer().schedule(this, 0); + } + _instance = null; _changes.Clear(); + + // + // Wait for the connection set to be cleared by the timer thread. + // + while(_connections.Count > 0) + { + System.Threading.Monitor.Wait(this); + } } } @@ -209,6 +228,7 @@ namespace IceInternal if(_instance == null) { _connections.Clear(); + System.Threading.Monitor.Pulse(this); return; } |