How to implement Canceleable spawn() from parent
aberba
karabutaworld at gmail.com
Mon Jun 29 23:34:04 UTC 2020
On Sunday, 28 June 2020 at 14:23:01 UTC, Stanislav Blinov wrote:
> On Sunday, 28 June 2020 at 13:29:08 UTC, aberba wrote:
>
>> [...]
>
>
> The error you're getting is because you're passing a pointer to
> a delegate instead of a delegate.
>
> [...]
So with this, without the Thread.sleep() to block main from
exiting, the spawned thread will terminate immediately. How do I
keep it from happening? Keep it running continuously?
From the docs, it says OwnerTerminated exception gets thrown when
the sending thread (e.i. main) is terminated.
> Thrown on calls to receive if the thread that spawned the
> receiving thread has terminated and no more messages exist.
More information about the Digitalmars-d-learn
mailing list