|
|
|
@ -84,6 +84,8 @@ static void on_compute_engine_detection_http_response( |
|
|
|
|
gpr_mu_unlock(GRPC_POLLSET_MU(&detector->pollset)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void destroy_pollset(void *p) { grpc_pollset_destroy(p); } |
|
|
|
|
|
|
|
|
|
static int is_stack_running_on_compute_engine(void) { |
|
|
|
|
compute_engine_detector detector; |
|
|
|
|
grpc_httpcli_request request; |
|
|
|
@ -114,12 +116,12 @@ static int is_stack_running_on_compute_engine(void) { |
|
|
|
|
while (!detector.is_done) { |
|
|
|
|
grpc_pollset_worker worker; |
|
|
|
|
grpc_pollset_work(&detector.pollset, &worker, |
|
|
|
|
gpr_inf_future(GPR_CLOCK_REALTIME)); |
|
|
|
|
gpr_inf_future(GPR_CLOCK_MONOTONIC)); |
|
|
|
|
} |
|
|
|
|
gpr_mu_unlock(GRPC_POLLSET_MU(&detector.pollset)); |
|
|
|
|
|
|
|
|
|
grpc_httpcli_context_destroy(&context); |
|
|
|
|
grpc_pollset_destroy(&detector.pollset); |
|
|
|
|
grpc_pollset_shutdown(&detector.pollset, destroy_pollset, &destroy_pollset); |
|
|
|
|
|
|
|
|
|
return detector.success; |
|
|
|
|
} |
|
|
|
|