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?
Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
July 26, 2021 Passing delegate indirectly to createLowLevelThread doesn't work | ||||
---|---|---|---|---|
| ||||
Can someone help? |
July 26, 2021 Re: Passing delegate indirectly to createLowLevelThread doesn't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tejas | On Monday, 26 July 2021 at 15:29:26 UTC, Tejas wrote: >
Can someone help? The delegate must be
|
July 26, 2021 Re: Passing delegate indirectly to createLowLevelThread doesn't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Backus | 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: >
Can someone help? The delegate must be
Doesn't seem to matter. I tried that beforehand. And even if it did why does passing it directly work without explicitly qualifying it as nothrow then? |
July 26, 2021 Re: Passing delegate indirectly to createLowLevelThread doesn't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tejas | 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: >
Can someone help? The delegate must be
Doesn't seem to matter. I tried that beforehand. And even if it did why does passing it directly work without explicitly qualifying it as nothrow then? Sorry, it seems to work now. But why didn't it fail when I didn't qualify |
July 26, 2021 Re: Passing delegate indirectly to createLowLevelThread doesn't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tejas | 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: >
Can someone help? The delegate must be
Doesn't seem to matter. I tried that beforehand. And even if it did why does passing it directly work without explicitly qualifying it as nothrow then? It does work for me. To me running the following explains why:
|
July 26, 2021 Re: Passing delegate indirectly to createLowLevelThread doesn't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to JG | 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
Doesn't seem to matter. I tried that beforehand. And even if it did why does passing it directly work without explicitly qualifying it as nothrow then? It does work for me. To me running the following explains why:
Yeah after reading the error diagnostics carefully I realized that the compiler is inferring many attributes when passing |
July 26, 2021 Re: Passing delegate indirectly to createLowLevelThread doesn't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tejas | 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 Well, technically, it is inferred there too, but since you specified Similar to the difference between like Object o = new MyClass; and auto c = new MyClass; |
July 26, 2021 Re: Passing delegate indirectly to createLowLevelThread doesn't work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D Ruppe | 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 Well, technically, it is inferred there too, but since you specified Similar to the difference between like Object o = new MyClass; and auto c = new MyClass; Thank you very much for further explaining this :D |