Ignore:
Timestamp:
Aug 25, 2017, 10:38:34 AM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
800d275
Parents:
af08051 (diff), 3eab308c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/thread

    raf08051 r28e58fd  
    2727// Anything that is resumed is a coroutine.
    2828trait is_thread(dtype T) {
    29       void ^?{}(T* mutex this);
    30       void main(T* this);
    31       thread_desc* get_thread(T* this);
     29      void ^?{}(T& mutex this);
     30      void main(T& this);
     31      thread_desc* get_thread(T& this);
    3232};
    3333
    34 #define DECL_THREAD(X) thread_desc* get_thread(X* this) { return &this->__thrd; } void main(X* this)
     34#define DECL_THREAD(X) thread_desc* get_thread(X& this) { return &this.__thrd; } void main(X& this)
    3535
    3636forall( dtype T | is_thread(T) )
    37 static inline coroutine_desc* get_coroutine(T* this) {
     37static inline coroutine_desc* get_coroutine(T & this) {
    3838        return &get_thread(this)->cor;
    3939}
    4040
    4141forall( dtype T | is_thread(T) )
    42 static inline monitor_desc* get_monitor(T * this) {
     42static inline monitor_desc* get_monitor(T & this) {
    4343        return &get_thread(this)->mon;
    4444}
     
    5555
    5656forall( dtype T | is_thread(T) )
    57 void __thrd_start( T* this );
     57void __thrd_start( T & this );
    5858
    5959//-----------------------------------------------------------------------------
    6060// Ctors and dtors
    61 void ?{}(thread_desc* this);
    62 void ^?{}(thread_desc* this);
     61void ?{}(thread_desc& this);
     62void ^?{}(thread_desc& this);
    6363
    6464//-----------------------------------------------------------------------------
     
    7070};
    7171
    72 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } )
    73 void ?{}( scoped(T)* this );
     72forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T&); } )
     73void ?{}( scoped(T)& this );
    7474
    75 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } )
    76 void ?{}( scoped(T)* this, P params );
     75forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T&, P); } )
     76void ?{}( scoped(T)& this, P params );
    7777
    7878forall( dtype T | sized(T) | is_thread(T) )
    79 void ^?{}( scoped(T)* this );
     79void ^?{}( scoped(T)& this );
    8080
    8181void yield();
Note: See TracChangeset for help on using the changeset viewer.