aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/census/initialize.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/census/initialize.c')
-rw-r--r--src/core/census/initialize.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/census/initialize.c b/src/core/census/initialize.c
index d72c08b91c..057ac78ee7 100644
--- a/src/core/census/initialize.c
+++ b/src/core/census/initialize.c
@@ -33,6 +33,18 @@
#include <grpc/census.h>
-int census_initialize(int functions) { return 0; }
+static int census_fns_enabled = CENSUS_NONE;
-void census_shutdown() {}
+int census_initialize(int functions) {
+ if (census_fns_enabled != CENSUS_NONE) {
+ return 1;
+ }
+ if (functions != CENSUS_NONE) {
+ return 1;
+ } else {
+ census_fns_enabled = functions;
+ return 0;
+ }
+}
+
+void census_shutdown() { census_fns_enabled = CENSUS_NONE; }