Can't Compile Global Semaphores?

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 27 13:01:27 PDT 2015


On 07/27/2015 12:56 PM, Steven Schveighoffer wrote:

> Instead, do this:
>
> shared Semaphore sem;
> shared static this() {
>     sem = new Semaphore();
> }
>
> Which will run during runtime startup.
>
> Or, you can initialize in main().
>
> -Steve

I tried that as well but there are tons of issues with shared. :(

Ali



More information about the Digitalmars-d-learn mailing list