Analogous knote locking logic compared to Linux implementation, now we don't fail assertions any more.

git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@511 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
This commit is contained in:
jocke 2011-05-19 14:18:22 +00:00
parent 68d14fabb0
commit 1f04856a80

View File

@ -155,6 +155,9 @@ solaris_kevent_copyout(struct kqueue *kq, int nready,
kn = evt->portev_user;
skip_event = 0;
dbg_printf("event=%s", port_event_dump(evt));
knote_lock(kn);
switch (evt->portev_source) {
case PORT_SOURCE_FD:
//XXX-FIXME WHAT ABOUT WRITE???
@ -201,6 +204,7 @@ solaris_kevent_copyout(struct kqueue *kq, int nready,
if (rv < 0) {
dbg_puts("kevent_copyout failed");
knote_unlock(kn);
return (-1);
}
@ -211,7 +215,13 @@ solaris_kevent_copyout(struct kqueue *kq, int nready,
if (eventlist->flags & EV_DISPATCH)
knote_disable(filt, kn); //TODO: Error checking
if (eventlist->flags & EV_ONESHOT)
{
knote_delete(filt, kn); //TODO: Error checking
}
else
{
knote_unlock(kn);
}
if (skip_event)
skipped_events++;