Ignore:
Timestamp:
Mar 23, 2017, 3:05:36 PM (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:
ae6f1ec
Parents:
bcda04c
Message:

Implemented thread keyword

Location:
src/libcfa/concurrency
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/thread

    rbcda04c rbd4d011  
    5656thread_desc * this_thread(void);
    5757
     58forall( dtype T | is_thread(T) )
     59void __thrd_start( T* this );
     60
    5861//-----------------------------------------------------------------------------
    5962// Ctors and dtors
  • src/libcfa/concurrency/thread.c

    rbcda04c rbd4d011  
    3131
    3232//-----------------------------------------------------------------------------
    33 // Forward declarations
    34 forall( dtype T | is_thread(T) )
    35 void start( T* this );
    36 
    37 //-----------------------------------------------------------------------------
    3833// Thread ctors and dtors
    3934
     
    5348void ?{}( scoped(T)* this ) {
    5449        (&this->handle){};
    55         start(&this->handle);
     50        __thrd_start(&this->handle);
    5651}
    5752
     
    5954void ?{}( scoped(T)* this, P params ) {
    6055        (&this->handle){ params };
    61         start(&this->handle);
     56        __thrd_start(&this->handle);
    6257}
    6358
     
    7065// Starting and stopping threads
    7166forall( dtype T | is_thread(T) )
    72 void start( T* this ) {
     67void __thrd_start( T* this ) {
    7368        coroutine_desc* thrd_c = get_coroutine(this);
    7469        thread_desc*  thrd_h = get_thread   (this);
Note: See TracChangeset for help on using the changeset viewer.