Ignore:
Timestamp:
Dec 17, 2020, 10:34:27 AM (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:
852ae0ea
Parents:
72a3aff (diff), 28e88d7 (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 plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r72a3aff r7a70fb2  
    2929
    3030        void ^?{}( info_thread(L) & this ){ }
     31
     32        info_thread(L) *& Back( info_thread(L) * this ) {
     33                return (info_thread(L) *)Back( (Seqable *)this );
     34        }
     35
     36        info_thread(L) *& Next( info_thread(L) * this ) {
     37                return (info_thread(L) *)Next( (Colable *)this );
     38        }
     39
     40        bool listed( info_thread(L) * this ) {
     41                return Next( (Colable *)this ) != 0p;
     42        }
    3143}
    3244
     
    5870                abort("A single acquisition lock holder attempted to reacquire the lock resulting in a deadlock.");
    5971        } else if ( owner != 0p && owner != active_thread() ) {
    60                 append( blocked_threads, active_thread() );
     72                addTail( blocked_threads, *active_thread() );
    6173                wait_count++;
    6274                unlock( lock );
     
    96108
    97109void pop_and_set_new_owner( blocking_lock & this ) with( this ) {
    98         $thread * t = pop_head( blocked_threads );
     110        $thread * t = &dropHead( blocked_threads );
    99111        owner = t;
    100112        recursion_count = ( t ? 1 : 0 );
     
    128140    lock( lock __cfaabi_dbg_ctx2 );
    129141        if ( owner != 0p ) {
    130                 append( blocked_threads, t );
     142                addTail( blocked_threads, *t );
    131143                wait_count++;
    132144                unlock( lock );
     
    257269                size_t recursion_count = 0;
    258270                if (i->lock) {
    259                         i->t->link.next = 1p;
    260271                        recursion_count = get_recursion_count(*i->lock);
    261272                        remove_( *i->lock );
Note: See TracChangeset for help on using the changeset viewer.