Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix: use EVRUN_ONCE in uv_run_once()
Browse files Browse the repository at this point in the history
EVRUN_NOWAIT means "poll and don't block". Use EVRUN_ONCE instead, "wait for
single event".
  • Loading branch information
typester authored and bnoordhuis committed Jan 11, 2012
1 parent 51ea46d commit e8494dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unix/core.c
Expand Up @@ -221,7 +221,7 @@ int uv_run(uv_loop_t* loop) {


int uv_run_once(uv_loop_t* loop) {
ev_run(loop->ev, EVRUN_NOWAIT);
ev_run(loop->ev, EVRUN_ONCE);
return 0;
}

Expand Down

5 comments on commit e8494dd

@mattn
Copy link
Contributor

@mattn mattn commented on e8494dd Jan 11, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@typester thanks!

@txdv
Copy link
Contributor

@txdv txdv commented on e8494dd Jan 11, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to have NOWAIT too (game engines would appreciate that, since they do not block at all and have to have a constant frame rate).

@typester
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, but I think uv_run_once is not suitable name for NOWAIT. It might be uv_poll or whatever IMHO

@txdv
Copy link
Contributor

@txdv txdv commented on e8494dd Jan 11, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is why I said 'we want to have that too' :)
uv_run_once_noblock?

@saghul
Copy link
Contributor

@saghul saghul commented on e8494dd Jan 11, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to @typester, I like uv_poll.

Please sign in to comment.