Function FiberGroup.spawnFiberIfOpen

Conditionally spawn a new fiber, only if the fiber group is currently open.

FiberHandle spawnFiberIfOpen (
  void delegate() dg
) nothrow @nogc @safe;

This function is useful in certain racy cases, where the fiber group has been closed, but has not yet finished closing.

Parameters

NameDescription
dg the delegate to run inside the fiber

Returns

The FiberHandle of the new fiber if successful, the invalid FiberHandle if the fiber group is closed or closing.