Threading errors.

Rory Mcguire rjmcguire at gm_no_ail.com
Tue Jul 27 02:25:05 PDT 2010


Philippe Sigaud wrote:

> On Mon, Jul 26, 2010 at 19:11, dcoder <dcoder at devnull.dev> wrote:
> 
>> == Quote from Rory Mcguire (rjmcguire at gm_no_ail.com)'s article
>> > Dmitry Olshansky wrote:
>>
> 
> 
> std.typecons.Tuple fields cannot be indexed like arrays, Andrei made a
> mistake. To access field  #n, use ._n or .field[n]. There is no difference
> between the two.
> 
> void writer() {
>  for( ;; ) {
>    auto msg = receiveOnly!(Tid, int)(); // msg is a Tuple!(Tid, int),
>    msg._0
> is a Tid, msg._1 is an int.
>    writeln( "Secondary thread: ", msg._1);
>    msg._0.send(thisTid);
>  }
> }
> 
> Also, in my case, the return; in writer must be commented out, or DMD
> complains it cannot be reached.
> 
> 
> Philippe


Interesting, I didn't have to comment out return; using dmd 2.047 on linux


More information about the Digitalmars-d-learn mailing list