Ignore:
Timestamp:
Jan 7, 2021, 3:27:00 PM (5 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:
2b4daf2, 64aeca0
Parents:
3c64c668 (diff), eef8dfb (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' into park_unpark

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/mutex.cfa

    r3c64c668 r58fe85a  
    3030        this.lock{};
    3131        this.blocked_threads{};
     32        this.is_locked = false;
    3233}
    3334
     
    3940        lock( lock __cfaabi_dbg_ctx2 );
    4041        if( is_locked ) {
    41                 append( blocked_threads, kernelTLS.this_thread );
     42                append( blocked_threads, active_thread() );
    4243                unlock( lock );
    4344                park();
     
    8586        lock( lock __cfaabi_dbg_ctx2 );
    8687        if( owner == 0p ) {
    87                 owner = kernelTLS.this_thread;
     88                owner = active_thread();
    8889                recursion_count = 1;
    8990                unlock( lock );
    9091        }
    91         else if( owner == kernelTLS.this_thread ) {
     92        else if( owner == active_thread() ) {
    9293                recursion_count++;
    9394                unlock( lock );
    9495        }
    9596        else {
    96                 append( blocked_threads, kernelTLS.this_thread );
     97                append( blocked_threads, active_thread() );
    9798                unlock( lock );
    9899                park();
     
    104105        lock( lock __cfaabi_dbg_ctx2 );
    105106        if( owner == 0p ) {
    106                 owner = kernelTLS.this_thread;
     107                owner = active_thread();
    107108                recursion_count = 1;
    108109                ret = true;
    109110        }
    110         else if( owner == kernelTLS.this_thread ) {
     111        else if( owner == active_thread() ) {
    111112                recursion_count++;
    112113                ret = true;
     
    158159void wait(condition_variable & this) {
    159160        lock( this.lock __cfaabi_dbg_ctx2 );
    160         append( this.blocked_threads, kernelTLS.this_thread );
     161        append( this.blocked_threads, active_thread() );
    161162        unlock( this.lock );
    162163        park();
     
    166167void wait(condition_variable & this, L & l) {
    167168        lock( this.lock __cfaabi_dbg_ctx2 );
    168         append( this.blocked_threads, kernelTLS.this_thread );
     169        append( this.blocked_threads, active_thread() );
    169170        unlock(l);
    170171        unlock(this.lock);
Note: See TracChangeset for help on using the changeset viewer.