Changeset a67c5b6 for libcfa/src


Ignore:
Timestamp:
May 5, 2021, 4:30:23 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
ce9ed84
Parents:
b9376fe
Message:

Processors now have a pointer to their tls.
This means the tls is no longer 100% private.
Use with care.

Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

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

    rb9376fe ra67c5b6  
    116116                $thread * thrd;
    117117        } init;
     118
     119        struct KernelThreadData * local_data;
    118120
    119121        #if !defined(__CFA_NO_STATISTICS__)
  • libcfa/src/concurrency/kernel/startup.cfa

    rb9376fe ra67c5b6  
    228228                __init_stats( __cfaabi_tls.this_stats );
    229229        #endif
     230        mainProcessor->local_data = &__cfaabi_tls;
    230231
    231232        // Enable preemption
     
    282283        #endif
    283284
     285        mainProcessor->local_data = 0p;
     286
    284287        unregister_tls( mainProcessor );
    285288
     
    329332        __cfaabi_tls.this_thread    = 0p;
    330333        __cfaabi_tls.preemption_state.[enabled, disable_count] = [false, 1];
     334        proc->local_data = &__cfaabi_tls;
    331335
    332336        register_tls( proc );
     
    368372                #endif
    369373        #endif
     374
     375        proc->local_data = 0p;
    370376
    371377        unregister_tls( proc );
     
    500506
    501507        this.init.thrd = initT;
     508
     509        this.local_data = 0p;
    502510
    503511        this.idle = eventfd(0, 0);
Note: See TracChangeset for help on using the changeset viewer.