Skip to content

Commit

Permalink
Fix race-condition in pipe close
Browse files Browse the repository at this point in the history
  • Loading branch information
akash-akya committed Jan 3, 2025
1 parent ee8d8db commit 2596fbd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion c_src/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,12 @@ static bool cancel_select(ErlNifEnv *env, int *fd) {

static void fd_rt_dtor(ErlNifEnv *env, void *obj) {
debug("fd_rt_dtor called");
int *fd = (int *)obj;
close_fd(fd);
}

static void fd_rt_stop(ErlNifEnv *env, void *obj, int fd, int is_direct_call) {
debug("fd_rt_stop called %d", fd);
close_fd(&fd);
}

static void fd_rt_down(ErlNifEnv *env, void *obj, ErlNifPid *pid,
Expand Down

0 comments on commit 2596fbd

Please sign in to comment.