Ignore:
Timestamp:
Jan 24, 2017, 11:45:13 AM (9 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:
60819df7
Parents:
63f78f0
Message:

cfa now supports processors which represent kernel threads, allowing basic parallelism

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/threads

    r63f78f0 r8def349  
    2727// Anything that implements this trait can be resumed.
    2828// Anything that is resumed is a coroutine.
    29 trait is_thread(dtype T /*| sized(T)*/) {
     29trait is_thread(dtype T | sized(T)) {
    3030      void main(T* this);
    3131      thread_h* get_thread(T* this);
    32         /*void ?{}(T*);
    33         void ^?{}(T*);*/
    3432};
    3533
    3634#define DECL_THREAD(X) static inline thread_h* get_thread(X* this) { return &this->t; } void main(X* this);
    3735
    38 forall(otype T | is_thread(T) )
     36forall( dtype T | sized(T) | is_thread(T) )
    3937static inline coroutine* get_coroutine(T* this) {
    4038        return &get_thread(this)->c;
     
    5553// thread runner
    5654// Structure that actually start and stop threads
    57 forall(otype T | is_thread(T) )
     55forall( dtype T | sized(T) | is_thread(T) )
    5856struct thread {
    5957        T handle;
    6058};
    6159
    62 forall(otype T | is_thread(T) )
     60forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } )
    6361void ?{}( thread(T)* this );
    6462
    65 forall(otype T, ttype P | is_thread(T) | { void ?{}(T*, P); } )
     63forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } )
    6664void ?{}( thread(T)* this, P params );
    6765
    68 forall(otype T | is_thread(T) )
     66forall( dtype T | sized(T) | is_thread(T) | { void ^?{}(T*); } )
    6967void ^?{}( thread(T)* this );
    7068
Note: See TracChangeset for help on using the changeset viewer.