|
|
@ -149,7 +149,7 @@ static void got_port_from_server(void *arg, |
|
|
|
GPR_ASSERT(port > 1024); |
|
|
|
GPR_ASSERT(port > 1024); |
|
|
|
gpr_mu_lock(GRPC_POLLSET_MU(&pr->pollset)); |
|
|
|
gpr_mu_lock(GRPC_POLLSET_MU(&pr->pollset)); |
|
|
|
pr->port = port; |
|
|
|
pr->port = port; |
|
|
|
grpc_pollset_kick(&pr->pollset); |
|
|
|
grpc_pollset_kick(&pr->pollset, NULL); |
|
|
|
gpr_mu_unlock(GRPC_POLLSET_MU(&pr->pollset)); |
|
|
|
gpr_mu_unlock(GRPC_POLLSET_MU(&pr->pollset)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -174,7 +174,9 @@ static int pick_port_using_server(char *server) { |
|
|
|
&pr); |
|
|
|
&pr); |
|
|
|
gpr_mu_lock(GRPC_POLLSET_MU(&pr.pollset)); |
|
|
|
gpr_mu_lock(GRPC_POLLSET_MU(&pr.pollset)); |
|
|
|
while (pr.port == -1) { |
|
|
|
while (pr.port == -1) { |
|
|
|
grpc_pollset_work(&pr.pollset, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)); |
|
|
|
grpc_pollset_worker worker; |
|
|
|
|
|
|
|
grpc_pollset_work(&pr.pollset, &worker, |
|
|
|
|
|
|
|
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)); |
|
|
|
} |
|
|
|
} |
|
|
|
gpr_mu_unlock(GRPC_POLLSET_MU(&pr.pollset)); |
|
|
|
gpr_mu_unlock(GRPC_POLLSET_MU(&pr.pollset)); |
|
|
|
|
|
|
|
|
|
|
|