Ashet OS

syscall: ashet.overlapped.await_completion_of

Documentation

Awaits one or more explicit asynchronous operations and returns the number of events elements.

The kernel will only await elements provided in events and all of those events must not be awaited by another await_completion_of.

When the function returns, events will have all completed events unchanged, and all unfinished events set to null. This way, a simple check via index can be done instead of the need for iteration of events to find what was finished.

Note:

This syscall will always return as soon as a single event has finished.

Note:

It is invalid to await the same operation with two concurrent calls to await_completion_of.

Note:

Elements awaited with this function will be guaranteed to not be returned by another concurrent call to await_completion.

Note:

For blocking operations, this function will suspend the current thread until the request has been completed.

Related Elements:

@ref await_completion

Inputs

events: []?*overlapped.ARC

Outputs

completed_count: usize

Errors

InvalidOperation
Unscheduled