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
createManualEvent). The semantics have changed a bit, so
signal.acquire() ... rawYield() ... signal.release()sequence
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
intinitially set to zero), which makes sure that
emithas 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.