Add thread safety annotations (#26935)

reviewable/pr26954/r1^2
Tamir Duberstein 3 years ago committed by GitHub
parent 83bcb0cf2e
commit f9581a6c4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/core/lib/surface/init.cc

@ -64,20 +64,18 @@ extern void grpc_register_built_in_plugins(void);
static gpr_once g_basic_init = GPR_ONCE_INIT;
static grpc_core::Mutex* g_init_mu;
static int g_initializations;
static int g_initializations ABSL_GUARDED_BY(g_init_mu) = 0;
static grpc_core::CondVar* g_shutting_down_cv;
static bool g_shutting_down;
static bool g_shutting_down ABSL_GUARDED_BY(g_init_mu) = false;
static void do_basic_init(void) {
gpr_log_verbosity_init();
g_init_mu = new grpc_core::Mutex();
g_shutting_down_cv = new grpc_core::CondVar();
g_shutting_down = false;
grpc_register_built_in_plugins();
grpc_cq_global_init();
grpc_core::grpc_executor_global_init();
gpr_time_init();
g_initializations = 0;
}
static bool append_filter(grpc_channel_stack_builder* builder, void* arg) {
@ -167,7 +165,8 @@ void grpc_init(void) {
GRPC_API_TRACE("grpc_init(void)", 0, ());
}
void grpc_shutdown_internal_locked(void) {
void grpc_shutdown_internal_locked(void)
ABSL_EXCLUSIVE_LOCKS_REQUIRED(g_init_mu) {
int i;
{
grpc_core::ExecCtx exec_ctx(0);

Loading…
Cancel
Save