Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resume() call directly inside desc's callback is safe in current implementation. Should remove that note from the comment. #8

Open
zhuyie opened this issue Aug 9, 2018 · 1 comment

Comments

@zhuyie
Copy link
Contributor

zhuyie commented Aug 9, 2018

No description provided.

@zhuyie zhuyie closed this as completed Aug 9, 2018
@zhuyie zhuyie changed the title Resume() call directly inside desc's callback is safe in current imple Resume() call directly inside desc's callback is safe in current implementation. Should remove that note from the comment. Aug 9, 2018
@zhuyie
Copy link
Contributor Author

zhuyie commented Aug 9, 2018

in the epoll/kqueue implementation, when callback invoked, no locks been held. looks like it's safe to call Resume() in callback.

but the following comment made me confused.

	// Start adds desc to the observation list.
	//
	// Note that if desc was configured with OneShot event, then poller will
	// remove it from its observation list. If you will be interested in
	// receiving events after the callback, call Resume(desc).
	//
	// Note that Resume() call directly inside desc's callback could cause
	// deadlock.
	//
	// Note that multiple calls with same desc will produce unexpected
	// behavior.
	Start(*Desc, CallbackFn) error

@zhuyie zhuyie reopened this Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant