Skip to content

Commit

Permalink
Init current and num_ready polls to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Nov 7, 2019
1 parent 12a235b commit 272cb05
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/eventing/epoll_kqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ struct us_loop_t *us_timer_loop(struct us_timer_t *t) {
struct us_loop_t *us_create_loop(void *hint, void (*wakeup_cb)(struct us_loop_t *loop), void (*pre_cb)(struct us_loop_t *loop), void (*post_cb)(struct us_loop_t *loop), unsigned int ext_size) {
struct us_loop_t *loop = (struct us_loop_t *) malloc(sizeof(struct us_loop_t) + ext_size);
loop->num_polls = 0;
/* These could be accessed if we close a poll before starting the loop */
loop->num_ready_polls = 0;
loop->current_ready_poll = 0;

#ifdef LIBUS_USE_EPOLL
loop->fd = epoll_create1(EPOLL_CLOEXEC);
Expand Down

0 comments on commit 272cb05

Please sign in to comment.