Re: Passing delegate indirectly to createLowLevelThread doesn't work

2021-07-26 Thread Tejas via Digitalmars-d-learn
On Monday, 26 July 2021 at 17:21:04 UTC, Adam D Ruppe wrote: On Monday, 26 July 2021 at 17:14:45 UTC, Tejas wrote: Yeah after reading the error diagnostics carefully I realized that the compiler is inferring many attributes when passing ```func``` directly but not when passing via delegate We

Re: Passing delegate indirectly to createLowLevelThread doesn't work

2021-07-26 Thread Adam D Ruppe via Digitalmars-d-learn
On Monday, 26 July 2021 at 17:14:45 UTC, Tejas wrote: Yeah after reading the error diagnostics carefully I realized that the compiler is inferring many attributes when passing ```func``` directly but not when passing via delegate Well, technically, it is inferred there too, but since you spec

Re: Passing delegate indirectly to createLowLevelThread doesn't work

2021-07-26 Thread Tejas via Digitalmars-d-learn
On Monday, 26 July 2021 at 17:01:13 UTC, JG wrote: On Monday, 26 July 2021 at 16:46:40 UTC, Tejas wrote: On Monday, 26 July 2021 at 15:42:44 UTC, Paul Backus wrote: On Monday, 26 July 2021 at 15:29:26 UTC, Tejas wrote: [...] The delegate must be `nothrow`: ```d void delegate() nothrow f; ``

Re: Passing delegate indirectly to createLowLevelThread doesn't work

2021-07-26 Thread JG via Digitalmars-d-learn
On Monday, 26 July 2021 at 16:46:40 UTC, Tejas wrote: On Monday, 26 July 2021 at 15:42:44 UTC, Paul Backus wrote: On Monday, 26 July 2021 at 15:29:26 UTC, Tejas wrote: ```d import std; import core.thread.osthread; void delegate() f; void main() { void func(){} f = &func; createLowL

Re: Passing delegate indirectly to createLowLevelThread doesn't work

2021-07-26 Thread Tejas via Digitalmars-d-learn
On Monday, 26 July 2021 at 16:46:40 UTC, Tejas wrote: On Monday, 26 July 2021 at 15:42:44 UTC, Paul Backus wrote: On Monday, 26 July 2021 at 15:29:26 UTC, Tejas wrote: ```d import std; import core.thread.osthread; void delegate() f; void main() { void func(){} f = &func; createLowL

Re: Passing delegate indirectly to createLowLevelThread doesn't work

2021-07-26 Thread Tejas via Digitalmars-d-learn
On Monday, 26 July 2021 at 15:42:44 UTC, Paul Backus wrote: On Monday, 26 July 2021 at 15:29:26 UTC, Tejas wrote: ```d import std; import core.thread.osthread; void delegate() f; void main() { void func(){} f = &func; createLowLevelThread(&func, 2<<30);//works createLowLevelThre

Re: Passing delegate indirectly to createLowLevelThread doesn't work

2021-07-26 Thread Paul Backus via Digitalmars-d-learn
On Monday, 26 July 2021 at 15:29:26 UTC, Tejas wrote: ```d import std; import core.thread.osthread; void delegate() f; void main() { void func(){} f = &func; createLowLevelThread(&func, 2<<30);//works createLowLevelThread(f, 2<<30);// doesn't work!! } ``` Can someone help? T

Passing delegate indirectly to createLowLevelThread doesn't work

2021-07-26 Thread Tejas via Digitalmars-d-learn
```d import std; import core.thread.osthread; void delegate() f; void main() { void func(){} f = &func; createLowLevelThread(&func, 2<<30);//works createLowLevelThread(f, 2<<30);// doesn't work!! } ``` Can someone help?