Ashet OS

namespace: ashet.overlapped

Types

System Calls

syscall schedule(in async_call: *overlapped.ARC)

Starts new asynchronous operations.

Note:

Until the operation has successfully completed or was cancelled, the ARC structure must be considered owned by the kernel and must not be changed from userspace. It can also change its contents spuriously until the operation is returned to userland.

syscall await_completion(in completed: []*overlapped.ARC, in options: Await_Options, out completed_count: usize)

Awaits one or more scheduled asynchronous operations and returns the number of completed elements.

The kernel will fill out completed up to the returned number of elements. All other values are undefined.

Note:

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

Related Elements:

@ref await_completion_of

syscall await_completion_of(in events: []?*overlapped.ARC, out completed_count: usize)

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

syscall cancel(in aop: *overlapped.ARC)

Cancels an asynchronous call.

Note:

If the operation has already completed, an error will be returned saying so.

Note:

The cancelled operation will not be returned by await_completion or await_completion_of anymore.