Ignore:
Timestamp:
Jan 19, 2021, 8:44:29 PM (10 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
dafbde8
Parents:
2f47ea4
Message:

Converting the project to use the new syntax for otype, dtype and ttytpe.

Changed prelude (gen), libcfa and test suite to use it. Added a simple deprecation rule of the old syntax to the parser; we might wish to support both syntaxes "officially," like with an extra CLI switch, but this measure should serve as a simple reminder for our team to try the new syntax.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/thread.cfa

    r2f47ea4 rfd54fef  
    6262}
    6363
    64 FORALL_DATA_INSTANCE(ThreadCancelled, (dtype thread_t), (thread_t))
     64FORALL_DATA_INSTANCE(ThreadCancelled, (thread_t &), (thread_t))
    6565
    66 forall(dtype T)
     66forall(T &)
    6767void copy(ThreadCancelled(T) * dst, ThreadCancelled(T) * src) {
    6868        dst->virtual_table = src->virtual_table;
     
    7171}
    7272
    73 forall(dtype T)
     73forall(T &)
    7474const char * msg(ThreadCancelled(T) *) {
    7575        return "ThreadCancelled";
    7676}
    7777
    78 forall(dtype T)
     78forall(T &)
    7979static void default_thread_cancel_handler(ThreadCancelled(T) & ) {
    8080        abort( "Unhandled thread cancellation.\n" );
    8181}
    8282
    83 forall(dtype T | is_thread(T) | IS_EXCEPTION(ThreadCancelled, (T)))
     83forall(T & | is_thread(T) | IS_EXCEPTION(ThreadCancelled, (T)))
    8484void ?{}( thread_dtor_guard_t & this,
    8585                T & thrd, void(*cancelHandler)(ThreadCancelled(T) &)) {
     
    124124//-----------------------------------------------------------------------------
    125125// Starting and stopping threads
    126 forall( dtype T | is_thread(T) )
     126forall( T & | is_thread(T) )
    127127void __thrd_start( T & this, void (*main_p)(T &) ) {
    128128        $thread * this_thrd = get_thread(this);
     
    140140//-----------------------------------------------------------------------------
    141141// Support for threads that don't ues the thread keyword
    142 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T&); } )
     142forall( T & | sized(T) | is_thread(T) | { void ?{}(T&); } )
    143143void ?{}( scoped(T)& this ) with( this ) {
    144144        handle{};
     
    146146}
    147147
    148 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T&, P); } )
     148forall( T &, P... | sized(T) | is_thread(T) | { void ?{}(T&, P); } )
    149149void ?{}( scoped(T)& this, P params ) with( this ) {
    150150        handle{ params };
     
    152152}
    153153
    154 forall( dtype T | sized(T) | is_thread(T) )
     154forall( T & | sized(T) | is_thread(T) )
    155155void ^?{}( scoped(T)& this ) with( this ) {
    156156        ^handle{};
     
    158158
    159159//-----------------------------------------------------------------------------
    160 forall(dtype T | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled, (T)))
     160forall(T & | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled, (T)))
    161161T & join( T & this ) {
    162162        thread_dtor_guard_t guard = { this, defaultResumptionHandler };
Note: See TracChangeset for help on using the changeset viewer.