NT waits can optionally be made "alertable". This is a special channel for thread wakeup that is mildly similar to SIGIO. A thread has an internal single bit of "alerted" state, and if a thread is alerted while an alertable wait, the wait will return a special value, consume the "alerted" state, and will not consume any of its objects. Alerts are implemented using events; the user-space NT emulator is expected to create an internal ntsync event for each thread and pass that event to wait functions.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -34,7 +34,8 @@ struct ntsync_wait_args { · 33 unmodified lines | |||
| 34 | __u32 index; | 34 | __u32 index; |
| 35 | __u32 flags; | 35 | __u32 flags; |
| 36 | __u32 owner; | 36 | __u32 owner; |
| 37 | __u32 pad[2]; | 37 | __u32 alert; |
| 38 | __u32 pad; | ||
| 38 | }; | 39 | }; |
| 39 | 40 | ||
| 40 | #define NTSYNC_MAX_WAIT_COUNT 64 | 41 | #define NTSYNC_MAX_WAIT_COUNT 64 |