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