Changeset 1696
- Timestamp:
- 06/29/10 21:24:38 (14 years ago)
- Files:
-
- trunk/phobos/std/concurrency.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/phobos/std/concurrency.d
r1686 r1696 589 589 * 590 590 * Params: 591 591 * ops = The operations to match. Each may return a bool to indicate 592 592 * whether a message with a matching type is truly a match. 593 593 * 594 594 * Throws: 595 595 * LinkTerminated if a linked thread terminated, or OwnerTerminated 596 596 * if the owner thread terminates and no existing messages match the 597 597 * supplied ops. 598 598 */ 599 final void get(T...)( T ops )599 final void get(T...)( T vals ) 600 600 { 601 601 static assert( T.length ); 602 602 603 603 static if( isImplicitlyConvertible!(T[0], long) ) 604 604 { 605 605 alias TypeTuple!(T[1 .. $]) Ops; 606 alias vals[1 .. $] ops; 607 assert( vals[0] >= 0 ); 606 608 enum timedWait = true; 607 assert( ops[0] >= 0 ); 608 long period = ops[0]; 609 ops = ops[1 .. $]; 609 long period = vals[0]; 610 610 } 611 611 else 612 612 { 613 613 alias TypeTuple!(T) Ops; 614 alias vals[0 .. $] ops; 614 615 enum timedWait = false; 615 616 } 616 617 617 618 bool onStandardMsg( Message msg ) 618 619 { 619 620 Variant data = msg.data; 620 621 621 622 foreach( i, t; Ops ) 622 623 { 623 624 alias ParameterTypeTuple!(t) Args;
