vibe.d beta banner
get vibe.d
0.10.0

Asynchronous I/O that doesn’t get in your way, written in D

Function switchToTask

Switches execution to the given task.

void switchToTask (
  Task t
) nothrow @safe;

void switchToTask (
  Task t,
  TaskSwitchPriority priority
) nothrow @safe;

This function can be used in conjunction with hibernate to wake up a task. The task must live in the same thread as the caller.

If no priority is specified, TaskSwitchPriority.prioritized or TaskSwitchPriority.immediate will be used, depending on whether a yield lock is currently active.

Note that it is illegal to use TaskSwitchPriority.immediate if a yield lock is active.

This function must only be called on tasks that belong to the calling thread and have previously been hibernated!

See Also

hibernate, yieldLock

Authors

Sönke Ludwig

Copyright

© 2012-2020 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.