Ignore:
File:
1 edited

Legend:

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

    rab8c6a6 re235429  
    2222#include "kernel.hfa"
    2323#include "monitor.hfa"
    24 #include "exception.hfa"
    2524
    2625//-----------------------------------------------------------------------------
    2726// thread trait
    2827trait is_thread(dtype T) {
    29         void ^?{}(T& mutex this);
    30         void main(T& this);
    31         $thread* get_thread(T& this);
     28      void ^?{}(T& mutex this);
     29      void main(T& this);
     30      $thread* get_thread(T& this);
    3231};
    33 
    34 FORALL_DATA_EXCEPTION(ThreadCancelled, (dtype thread_t), (thread_t)) (
    35         thread_t * the_thread;
    36         exception_t * the_exception;
    37 );
    38 
    39 forall(dtype T)
    40 void copy(ThreadCancelled(T) * dst, ThreadCancelled(T) * src);
    41 
    42 forall(dtype T)
    43 const char * msg(ThreadCancelled(T) *);
    4432
    4533// define that satisfies the trait without using the thread keyword
     
    7765static inline void ?{}($thread & this, const char * const name, struct cluster & cl )                   { this{ name, cl, 0p, 65000 }; }
    7866static inline void ?{}($thread & this, const char * const name, struct cluster & cl, size_t stackSize ) { this{ name, cl, 0p, stackSize }; }
    79 
    80 struct thread_dtor_guard_t {
    81         monitor_dtor_guard_t mg;
    82 };
    83 
    84 forall( dtype T | is_thread(T) | IS_EXCEPTION(ThreadCancelled, (T)) )
    85 void ?{}( thread_dtor_guard_t & this, T & thrd, void(*)(ThreadCancelled(T) &) );
    86 void ^?{}( thread_dtor_guard_t & this );
    8767
    8868//-----------------------------------------------------------------------------
     
    128108//----------
    129109// join
    130 forall( dtype T | is_thread(T) | IS_RESUMPTION_EXCEPTION(ThreadCancelled, (T)) )
     110forall( dtype T | is_thread(T) )
    131111T & join( T & this );
    132112
Note: See TracChangeset for help on using the changeset viewer.