16 Dec
2008
16 Dec
'08
5:21 a.m.
On Tue, 2008-12-16 at 05:01 +0200, Timo Sirainen wrote:
Patch #3. Some versions of Mac OS X return near-duplicate kevents.
This probably won't affect other BSDs, so I think the duplicate removal should be around #ifdef __APPLE__?
Hmm. Actually I think when I was writing that code I noticed the same thing and tried to fix it with:
/* there can be multiple events for a single io.
call the callback only once if that happens. */
if (io->refcount == 2 && io->io.callback != NULL)
io->io.callback(io->io.context);
But later (although inside the same commit..) I probably added the assert to:
for (i = 0; i < ret; i++) {
io = (void *)events[i].udata;
i_assert(io->refcount == 1);
io->refcount++;
}
Which makes the refcount == 2 check pointless. I think it would work correctly simply if the assert was removed?