Skip to content
Snippets Groups Projects
Commit e16372ba authored by Craig Tiller's avatar Craig Tiller
Browse files

Cleanup to make compile

parent 70652147
No related branches found
No related tags found
No related merge requests found
......@@ -969,7 +969,6 @@ static grpc_fd *fd_create(int fd, const char *name) {
gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1);
new_fd->fd = fd;
gpr_atm_no_barrier_store(&new_fd->shutdown_error, (gpr_atm)GRPC_ERROR_NONE);
new_fd->orphaned = false;
grpc_lfev_init(&new_fd->read_closure);
grpc_lfev_init(&new_fd->write_closure);
......@@ -1070,9 +1069,10 @@ static bool fd_is_shutdown(grpc_fd *fd) {
/* Might be called multiple times */
static void fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_error *why) {
if (grpc_lfev_set_shutdown(&fd->read_closure, GRPC_ERROR_REF(why))) {
if (grpc_lfev_set_shutdown(exec_ctx, &fd->read_closure,
GRPC_ERROR_REF(why))) {
shutdown(fd->fd, SHUT_RDWR);
grpc_lfev_set_shutdown(&fd->write_closure, GRPC_ERROR_REF(why));
grpc_lfev_set_shutdown(exec_ctx, &fd->write_closure, GRPC_ERROR_REF(why));
}
GRPC_ERROR_UNREF(why);
}
......@@ -1286,7 +1286,7 @@ static void fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
}
static void fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
grpc_lfev_set_ready(exec_ctx, fd, &fd->write_closure);
grpc_lfev_set_ready(exec_ctx, &fd->write_closure);
}
static void pollset_release_polling_island(grpc_exec_ctx *exec_ctx,
......
......@@ -69,12 +69,26 @@
#define CLOSURE_NOT_READY ((gpr_atm)0)
#define CLOSURE_READY ((gpr_atm)2)
#define FD_SHUTDOWN_BIT 1
#define FD_SHUTDOWN_BIT ((gpr_atm)1)
void grpc_lfev_init(gpr_atm *state) {
gpr_atm_no_barrier_store(state, CLOSURE_NOT_READY);
}
void grpc_lfev_destroy(gpr_atm *state) {
gpr_atm curr = gpr_atm_no_barrier_load(state);
if (curr & FD_SHUTDOWN_BIT) {
GRPC_ERROR_UNREF((grpc_error *)(curr & ~FD_SHUTDOWN_BIT));
} else {
GPR_ASSERT(curr == CLOSURE_NOT_READY || curr == CLOSURE_READY);
}
}
bool grpc_lfev_is_shutdown(gpr_atm *state) {
gpr_atm curr = gpr_atm_no_barrier_load(state);
return (curr & FD_SHUTDOWN_BIT) != 0;
}
void grpc_lfev_notify_on(grpc_exec_ctx *exec_ctx, gpr_atm *state,
grpc_closure *closure) {
while (true) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment