Ignore:
Timestamp:
Jan 30, 2018, 4:52:54 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
1449d83, 5ff188f
Parents:
320eb73a (diff), 7416d46a (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 plg2:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r320eb73a r633a642  
    3131// Thread ctors and dtors
    3232
    33 void ?{}(thread_desc& this) {
    34         (this.self_cor){};
    35         this.self_cor.name = "Anonymous Thread";
    36         this.self_mon.owner = &this;
    37         this.self_mon.recursion = 1;
    38         this.self_mon_p = &this.self_mon;
    39         this.next = NULL;
     33void ?{}(thread_desc& this) with( this ) {
     34        self_cor{};
     35        self_cor.name = "Anonymous Coroutine";
     36        self_mon.owner = &this;
     37        self_mon.recursion = 1;
     38        self_mon_p = &self_mon;
     39        next = NULL;
    4040        __cfaabi_dbg_debug_do(
    41                 this.dbg_next = NULL;
    42                 this.dbg_prev = NULL;
     41                dbg_next = NULL;
     42                dbg_prev = NULL;
    4343                __cfaabi_dbg_thread_register(&this);
    4444        )
    4545
    46         (this.monitors){ &this.self_mon_p, 1, (fptr_t)0 };
     46        monitors{ &self_mon_p, 1, (fptr_t)0 };
    4747}
    4848
    49 void ^?{}(thread_desc& this) {
    50         __cfaabi_dbg_debug_do(
    51                 __cfaabi_dbg_thread_unregister(&this);
    52         )
    53         ^(this.self_cor){};
     49void ^?{}(thread_desc& this) with( this ) {
     50        ^self_cor{};
    5451}
    5552
    5653forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T&); } )
    57 void ?{}( scoped(T)& this ) {
    58         (this.handle){};
    59         __thrd_start(this.handle);
     54void ?{}( scoped(T)& this ) with( this ) {
     55        handle{};
     56        __thrd_start(handle);
    6057}
    6158
    6259forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T&, P); } )
    63 void ?{}( scoped(T)& this, P params ) {
    64         (this.handle){ params };
    65         __thrd_start(this.handle);
     60void ?{}( scoped(T)& this, P params ) with( this ) {
     61        handle{ params };
     62        __thrd_start(handle);
    6663}
    6764
    6865forall( dtype T | sized(T) | is_thread(T) )
    69 void ^?{}( scoped(T)& this ) {
    70         ^(this.handle){};
     66void ^?{}( scoped(T)& this ) with( this ) {
     67        ^handle{};
    7168}
    7269
     
    7673void __thrd_start( T& this ) {
    7774        coroutine_desc* thrd_c = get_coroutine(this);
    78         thread_desc* thrd_h = get_thread   (this);
     75        thread_desc   * thrd_h = get_thread   (this);
    7976        thrd_c->last = this_coroutine;
    8077
Note: See TracChangeset for help on using the changeset viewer.