Thread overview | |||||
---|---|---|---|---|---|
|
September 02, 2017 SDL and new Thread open two windows | ||||
---|---|---|---|---|
| ||||
Im using SDL2 with derelict, on ubuntu. Last DMD. When using spawn or new Thread like : spawn( (){ while(true){ Thread.sleep(500.msecs); }); the program open two SDL windows. Whats going on , and how to prevent this ? |
September 02, 2017 Re: SDL and new Thread open two windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to SrMordred | On Saturday, 2 September 2017 at 03:41:47 UTC, SrMordred wrote:
> Whats going on , and how to prevent this ?
Are you using a static this anywhere?
|
September 02, 2017 Re: SDL and new Thread open two windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Saturday, 2 September 2017 at 03:47:24 UTC, Adam D. Ruppe wrote:
> On Saturday, 2 September 2017 at 03:41:47 UTC, SrMordred wrote:
>> Whats going on , and how to prevent this ?
>
> Are you using a static this anywhere?
Hm, right.
I was constructing the window there.
Forgot that static this will execute on all threads.
Thanks!
Removing the code from "static this" solved.
putting "__gshared" also.
But "shared" crashes the programs...
|
Copyright © 1999-2021 by the D Language Foundation