Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/uC++toCFA/uC++toCFA.tex

    rd96f7c4 r3b21c96  
    1111%% Created On       : Wed Apr  6 14:53:29 2016
    1212%% Last Modified By : Peter A. Buhr
    13 %% Last Modified On : Fri Jan 17 07:39:09 2025
    14 %% Update Count     : 6284
     13%% Last Modified On : Thu Jan 16 11:49:47 2025
     14%% Update Count     : 6281
    1515%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    1616
     
    588588
    589589
     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};
     612void 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
    590623\section{\lstinline{COBEGIN}/\lstinline{COFOR}}
    591624
     
    601634                BEGIN osacquire( cout ) << "C" << endl; END
    602635                BEGIN osacquire( cout ) << "D" << endl; END
     636                BEGIN osacquire( cout ) << "E" << endl; END
    603637        @COEND@
    604638        @COFOR@( i, 1, 10,
     
    617651                corun { mutex( sout ) sout | "C"; }
    618652                corun { mutex( sout ) sout | "D"; }
     653                corun { mutex( sout ) sout | "E"; }
    619654        }
    620655        @cofor@( i; 10 ) {
     
    700735}
    701736\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 fields
    714         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 fields
    726 
    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}}
    735737\end{tabular}
    736738\end{cquote}
Note: See TracChangeset for help on using the changeset viewer.