|
|
@ -179,12 +179,16 @@ class ChannelData { |
|
|
|
|
|
|
|
|
|
|
|
void RemoveExternalConnectivityWatcher(grpc_closure* on_complete, |
|
|
|
void RemoveExternalConnectivityWatcher(grpc_closure* on_complete, |
|
|
|
bool cancel) { |
|
|
|
bool cancel) { |
|
|
|
MutexLock lock(&external_watchers_mu_); |
|
|
|
ExternalConnectivityWatcher* watcher = nullptr; |
|
|
|
auto it = external_watchers_.find(on_complete); |
|
|
|
{ |
|
|
|
if (it != external_watchers_.end()) { |
|
|
|
MutexLock lock(&external_watchers_mu_); |
|
|
|
if (cancel) it->second->Cancel(); |
|
|
|
auto it = external_watchers_.find(on_complete); |
|
|
|
external_watchers_.erase(it); |
|
|
|
if (it != external_watchers_.end()) { |
|
|
|
|
|
|
|
watcher = it->second; |
|
|
|
|
|
|
|
external_watchers_.erase(it); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (watcher != nullptr && cancel) watcher->Cancel(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int NumExternalConnectivityWatchers() const { |
|
|
|
int NumExternalConnectivityWatchers() const { |
|
|
|