Lines Matching refs:wrapper

61 void php_grpc_channel_ref(grpc_channel_wrapper* wrapper) {  in php_grpc_channel_ref()  argument
62 gpr_mu_lock(&wrapper->mu); in php_grpc_channel_ref()
63 wrapper->ref_count += 1; in php_grpc_channel_ref()
64 gpr_mu_unlock(&wrapper->mu); in php_grpc_channel_ref()
67 void php_grpc_channel_unref(grpc_channel_wrapper* wrapper) { in php_grpc_channel_unref() argument
68 gpr_mu_lock(&wrapper->mu); in php_grpc_channel_unref()
69 wrapper->ref_count -= 1; in php_grpc_channel_unref()
70 if (wrapper->ref_count == 0) { in php_grpc_channel_unref()
71 free_grpc_channel_wrapper(wrapper, true); in php_grpc_channel_unref()
72 gpr_mu_unlock(&wrapper->mu); in php_grpc_channel_unref()
73 free(wrapper); in php_grpc_channel_unref()
74 wrapper = NULL; in php_grpc_channel_unref()
77 gpr_mu_unlock(&wrapper->mu); in php_grpc_channel_unref()
84 if (p->wrapper != NULL) {
85 php_grpc_channel_unref(p->wrapper);
86 p->wrapper = NULL;
221 channel->wrapper->wrapped = grpc_insecure_channel_create(target, &args, in create_channel()
224 channel->wrapper->wrapped = in create_channel()
228 php_grpc_channel_ref(channel->wrapper); in create_channel()
269 le->channel = channel->wrapper; in create_and_add_channel_to_persistent_list()
275 php_grpc_channel_ref(channel->wrapper); in create_and_add_channel_to_persistent_list()
390 channel->wrapper = malloc(sizeof(grpc_channel_wrapper)); in PHP_METHOD()
391 channel->wrapper->ref_count = 0; in PHP_METHOD()
392 channel->wrapper->key = key; in PHP_METHOD()
393 channel->wrapper->target = strdup(target); in PHP_METHOD()
394 channel->wrapper->args_hashstr = strdup(sha1str); in PHP_METHOD()
395 channel->wrapper->creds_hashstr = NULL; in PHP_METHOD()
400 channel->wrapper->creds_hashstr = channel_creds_hashstr; in PHP_METHOD()
403 gpr_mu_init(&channel->wrapper->mu); in PHP_METHOD()
426 free_grpc_channel_wrapper(channel->wrapper, false); in PHP_METHOD()
427 gpr_mu_destroy(&channel->wrapper->mu); in PHP_METHOD()
428 free(channel->wrapper); in PHP_METHOD()
429 channel->wrapper = NULL; in PHP_METHOD()
430 channel->wrapper = le->channel; in PHP_METHOD()
432 php_grpc_channel_ref(channel->wrapper); in PHP_METHOD()
445 if (channel->wrapper == NULL) { in PHP_METHOD()
451 gpr_mu_lock(&channel->wrapper->mu); in PHP_METHOD()
452 char *target = grpc_channel_get_target(channel->wrapper->wrapped); in PHP_METHOD()
453 gpr_mu_unlock(&channel->wrapper->mu); in PHP_METHOD()
466 if (channel->wrapper == NULL) { in PHP_METHOD()
472 gpr_mu_lock(&channel->wrapper->mu); in PHP_METHOD()
479 gpr_mu_unlock(&channel->wrapper->mu); in PHP_METHOD()
482 int state = grpc_channel_check_connectivity_state(channel->wrapper->wrapped, in PHP_METHOD()
484 gpr_mu_unlock(&channel->wrapper->mu); in PHP_METHOD()
498 if (channel->wrapper == NULL) { in PHP_METHOD()
504 gpr_mu_lock(&channel->wrapper->mu); in PHP_METHOD()
515 gpr_mu_unlock(&channel->wrapper->mu); in PHP_METHOD()
521 grpc_channel_watch_connectivity_state(channel->wrapper->wrapped, in PHP_METHOD()
528 gpr_mu_unlock(&channel->wrapper->mu); in PHP_METHOD()
539 if (channel->wrapper != NULL) { in PHP_METHOD()
540 php_grpc_channel_unref(channel->wrapper); in PHP_METHOD()
541 channel->wrapper = NULL; in PHP_METHOD()
621 sizeof("target"), channel->wrapper->target, true); in PHP_METHOD()
624 update_and_get_target_upper_bound(channel->wrapper->target, -1); in PHP_METHOD()
631 sizeof("key"), channel->wrapper->key, true); in PHP_METHOD()
634 sizeof("ref_count"), channel->wrapper->ref_count); in PHP_METHOD()
637 grpc_channel_check_connectivity_state(channel->wrapper->wrapped, (int)0); in PHP_METHOD()
646 sizeof("is_valid"), (channel->wrapper == NULL)); in PHP_METHOD()