Ignore:
Timestamp:
Jan 30, 2018, 3:52:42 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, stuck-waitfor-destruct, with_gc
Children:
f792cb8
Parents:
5b51f5e
Message:

Kernel now properly uses with statments

File:
1 edited

Legend:

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

    r5b51f5e r65deb18  
    3131// Thread ctors and dtors
    3232
    33 void ?{}(thread_desc& this) {
    34         (this.self_cor){};
    35         this.self_cor.name = "Anonymous Coroutine";
    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
    41         (this.monitors){ &this.self_mon_p, 1, (fptr_t)0 };
     41        monitors{ &self_mon_p, 1, (fptr_t)0 };
    4242}
    4343
    44 void ^?{}(thread_desc& this) {
    45         ^(this.self_cor){};
     44void ^?{}(thread_desc& this) with( this ) {
     45        ^self_cor{};
    4646}
    4747
    4848forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T&); } )
    49 void ?{}( scoped(T)& this ) {
    50         (this.handle){};
    51         __thrd_start(this.handle);
     49void ?{}( scoped(T)& this ) with( this ) {
     50        handle{};
     51        __thrd_start(handle);
    5252}
    5353
    5454forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T&, P); } )
    55 void ?{}( scoped(T)& this, P params ) {
    56         (this.handle){ params };
    57         __thrd_start(this.handle);
     55void ?{}( scoped(T)& this, P params ) with( this ) {
     56        handle{ params };
     57        __thrd_start(handle);
    5858}
    5959
    6060forall( dtype T | sized(T) | is_thread(T) )
    61 void ^?{}( scoped(T)& this ) {
    62         ^(this.handle){};
     61void ^?{}( scoped(T)& this ) with( this ) {
     62        ^handle{};
    6363}
    6464
     
    6868void __thrd_start( T& this ) {
    6969        coroutine_desc* thrd_c = get_coroutine(this);
    70         thread_desc* thrd_h = get_thread   (this);
     70        thread_desc   * thrd_h = get_thread   (this);
    7171        thrd_c->last = this_coroutine;
    7272
Note: See TracChangeset for help on using the changeset viewer.