Changes in doc/uC++toCFA/uC++toCFA.tex [d96f7c4:3b21c96]
- File:
-
- 1 edited
-
doc/uC++toCFA/uC++toCFA.tex (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/uC++toCFA/uC++toCFA.tex
rd96f7c4 r3b21c96 11 11 %% Created On : Wed Apr 6 14:53:29 2016 12 12 %% Last Modified By : Peter A. Buhr 13 %% Last Modified On : Fri Jan 17 07:39:09202514 %% Update Count : 628 413 %% Last Modified On : Thu Jan 16 11:49:47 2025 14 %% Update Count : 6281 15 15 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 16 … … 588 588 589 589 590 \section{Thread} 591 592 \begin{cquote} 593 \begin{tabular}{@{}l|ll@{}} 594 \begin{uC++} 595 596 @_Task@ T { 597 // private task fields 598 void main() { 599 ... @_Resume E( ... ) _At partner@; 600 ... @uThisTask();@ ... 601 } 602 public: 603 }; 604 \end{uC++} 605 & 606 \begin{cfa} 607 #include <$thread$.hfa> 608 @thread@ T { 609 // private task fields 610 611 }; 612 void main( @T & t@ ) { 613 ... @resumeAt( partner, ExceptionInst( E, ... )@ ); 614 ... @active_thread();@ ... 615 } 616 \end{cfa} 617 \\ 618 \multicolumn{2}{@{}l@{}}{\lstinline{T t; // start thread in main routine}} 619 \end{tabular} 620 \end{cquote} 621 622 590 623 \section{\lstinline{COBEGIN}/\lstinline{COFOR}} 591 624 … … 601 634 BEGIN osacquire( cout ) << "C" << endl; END 602 635 BEGIN osacquire( cout ) << "D" << endl; END 636 BEGIN osacquire( cout ) << "E" << endl; END 603 637 @COEND@ 604 638 @COFOR@( i, 1, 10, … … 617 651 corun { mutex( sout ) sout | "C"; } 618 652 corun { mutex( sout ) sout | "D"; } 653 corun { mutex( sout ) sout | "E"; } 619 654 } 620 655 @cofor@( i; 10 ) { … … 700 735 } 701 736 \end{cfa} 702 \end{tabular}703 \end{cquote}704 705 706 \section{Thread}707 708 \begin{cquote}709 \begin{tabular}{@{}l|ll@{}}710 \begin{uC++}711 712 @_Task@ T {713 // private task fields714 void main() {715 ... @_Resume E( ... ) _At partner@;716 ... @uThisTask();@ ...717 }718 public:719 };720 \end{uC++}721 &722 \begin{cfa}723 #include <$thread$.hfa>724 @thread@ T {725 // private task fields726 727 };728 void main( @T & t@ ) {729 ... @resumeAt( partner, ExceptionInst( E, ... )@ );730 ... @active_thread();@ ...731 }732 \end{cfa}733 \\734 \multicolumn{2}{@{}l@{}}{\lstinline{T t; // start thread in main routine}}735 737 \end{tabular} 736 738 \end{cquote}
Note:
See TracChangeset
for help on using the changeset viewer.