> remove wait from waiters queue > critical_section_unlock(events[i]); > } > } > > Also I think it would be nice to avoid allocation in case of waiting for only one handle (or just in event_wait function). > > What do you think about it? sounds good. I'll update and resend