feat: Minimize contention in Bigtable Client initialization. (#2923)
feat: Minimize contention in Bigtable Client initialization. (#2923)

Channel pools for Bigtable clients are lazy initialized, the first
thread that needs them creates them. To avoid deadlocks and unbound
priority inversions this thread releases the locks while creating the
pools, and relocks before saving the newly created pool.

In some cases two (or more) threads may create the pool, in this case
the pool created by the second thread is discarded. We were discarding
this work with the lock held, which resulted in deadlocks for some
users inside Google (this should not affect external users).

googleapis/google-cloud-cpp,googleapis/google-cloud-cpp,googleapis/google-cloud-cpp,googleapis/google-cloud-cpp