|
|
|
@ -106,8 +106,11 @@ void grpc_pollset_init(grpc_pollset *pollset) { |
|
|
|
|
void grpc_pollset_add_fd(grpc_pollset *pollset, grpc_fd *fd) { |
|
|
|
|
gpr_mu_lock(&pollset->mu); |
|
|
|
|
pollset->vtable->add_fd(pollset, fd, 1); |
|
|
|
|
/* the following (enabled only in debug) will reacquire and then releast
|
|
|
|
|
our lock - meaning that if the unlocking flag passed to del_fd above is |
|
|
|
|
not respected, the code will deadlock (in a way that we have a chance of |
|
|
|
|
debugging) */ |
|
|
|
|
#ifndef NDEBUG |
|
|
|
|
/* this will deadlock if the unlocking rules aren't correctly implemented */ |
|
|
|
|
gpr_mu_lock(&pollset->mu); |
|
|
|
|
gpr_mu_unlock(&pollset->mu); |
|
|
|
|
#endif |
|
|
|
@ -116,8 +119,11 @@ void grpc_pollset_add_fd(grpc_pollset *pollset, grpc_fd *fd) { |
|
|
|
|
void grpc_pollset_del_fd(grpc_pollset *pollset, grpc_fd *fd) { |
|
|
|
|
gpr_mu_lock(&pollset->mu); |
|
|
|
|
pollset->vtable->del_fd(pollset, fd, 1); |
|
|
|
|
/* the following (enabled only in debug) will reacquire and then releast
|
|
|
|
|
our lock - meaning that if the unlocking flag passed to del_fd above is |
|
|
|
|
not respected, the code will deadlock (in a way that we have a chance of |
|
|
|
|
debugging) */ |
|
|
|
|
#ifndef NDEBUG |
|
|
|
|
/* this will deadlock if the unlocking rules aren't correctly implemented */ |
|
|
|
|
gpr_mu_lock(&pollset->mu); |
|
|
|
|
gpr_mu_unlock(&pollset->mu); |
|
|
|
|
#endif |
|
|
|
|