Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/thread

    r348006f rcb0e6de  
    2222
    2323#include "coroutine"
     24#include "monitor"
    2425
    2526//-----------------------------------------------------------------------------
     
    2829// Anything that is resumed is a coroutine.
    2930trait is_thread(dtype T) {
     31      void ^?{}(T* mutex this);
    3032      void main(T* this);
    3133      thread_desc* get_thread(T* this);
    3234};
    3335
    34 #define DECL_THREAD(X) thread_desc* get_thread(X* this) { return &this->t; } void main(X* this)
     36#define DECL_THREAD(X) thread_desc* get_thread(X* this) { return &this->__thrd; } void main(X* this)
    3537
    3638forall( dtype T | is_thread(T) )
    3739static inline coroutine_desc* get_coroutine(T* this) {
    38         return &get_thread(this)->c;
     40        return &get_thread(this)->cor;
    3941}
    4042
    41 static inline coroutine_desc* get_coroutine(thread_desc* this) {
    42         return &this->c;
     43forall( dtype T | is_thread(T) )
     44static inline monitor_desc* get_monitor(T * this) {
     45        return &get_thread(this)->mon;
     46}
     47
     48static inline coroutine_desc* get_coroutine(thread_desc * this) {
     49        return &this->cor;
     50}
     51
     52static inline monitor_desc* get_monitor(thread_desc * this) {
     53        return &this->mon;
    4354}
    4455
     
    6475void ?{}( scoped(T)* this, P params );
    6576
    66 forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); } )
     77forall( dtype T | sized(T) | is_thread(T) )
    6778void ^?{}( scoped(T)* this );
    6879
Note: See TracChangeset for help on using the changeset viewer.