On Mon, 14 Jan 2019 20:34:59 +0100, Sönke Ludwig wrote:

Am 02.01.2019 um 10:38 schrieb Mengu:

The direct equivalent would be vibe.core.sync.LocalManualEvent
(created with createManualEvent). The semantics have changed a bit, so
that the signal.acquire() ... rawYield() ... signal.release() sequence
becomes just signal.wait().

The original code also doesn't use the wait counter, which is necessary
to guarantee race-condition free waiting, so the code should be adjusted
further by doing counter = signal.wait(counter); (counter being an
int initially set to zero), which makes sure that wait doesn't block
if emit has already been called in the meantime.

There are also two alternatives that could also be used for waiting -
InterruptibleTaskCondition (a normal condition variable) and
std.concurrency (message passing). The former is combined with a mutex
and could be used to make the code robust against multiple tasks trying
to send data at the same time.

thank you very much sonke. i'll give these a try.