Concurency wtf?

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 8 12:05:19 PDT 2015


On 9/8/15 2:54 PM, Prudence wrote:
>
> I can't seem to receive certain messages, my code is very simple and it
> all works except for receiving:
>
>
> in one thread I do
>
>
> locate("MyMonitor").send(cast(shared)pt);

You are casting to shared here.

>
> which sends the message(pt is a windows POINT structure).
>
> In the MyMonitor spawned thread, I have
>
>
>          while (true)
>          {
>              POINT y;
>              receiveTimeout(100.msecs,
>                      (POINT p)

But not receiving a shared(POINT) here.

So the types are different.

What is a POINT struct? If it's simple POD (with no pointers), then you 
don't need the shared type modifier.

-Steve


More information about the Digitalmars-d-learn mailing list