mailru / easygo

Tools for building go apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

zhuyie opened this issue · comments

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