Ignore:
Timestamp:
Dec 3, 2020, 4:38:01 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:
bd8dca2
Parents:
27b1ca1 (diff), cad1df1 (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.hfa

    r27b1ca1 rc74e601  
    55#include "bits/algorithm.hfa"
    66#include "bits/locks.hfa"
     7#include "bits/sequence.hfa"
    78#include "bits/containers.hfa"
    89
     
    3132forall(dtype L | is_blocking_lock(L)) {
    3233        struct info_thread {
     34                inline Seqable;
    3335                struct $thread * t;
    3436                uintptr_t info;
    35                 info_thread(L) * next;
    3637                L * lock;
    3738                bool listed;                                    // true if info_thread is on queue, false otherwise;
     
    4243        void ?{}( info_thread(L) & this, $thread * t, uintptr_t info );
    4344        void ^?{}( info_thread(L) & this );
    44 
    45         info_thread(L) *& get_next( info_thread(L) & this );
    4645}
    4746
     
    5049///////////////////////////////////////////////////////////////////
    5150
     51// struct lock_thread {
     52//      struct $thread * t;
     53//      lock_thread * next;
     54// };
     55
     56// void ?{}( lock_thread & this, struct $thread * thd );
     57// void ^?{}( lock_thread & this );
     58
     59// lock_thread *& get_next( lock_thread & );
     60
    5261struct blocking_lock {
    5362        // Spin lock used for mutual exclusion
     
    5564
    5665        // List of blocked threads
    57         __queue_t( struct $thread ) blocked_threads;
     66        __queue_t( $thread ) blocked_threads;
    5867
    5968        // Count of current blocked threads
     
    135144                __spinlock_t lock;
    136145
     146                info_thread(L) * last_thread;
     147
    137148                // List of blocked threads
    138                 __queue_t( info_thread(L) ) blocked_threads;
     149                Sequence( info_thread(L) ) blocked_threads;
    139150
    140151                // Count of current blocked threads
     
    150161                condition_variable(L) * cond;
    151162
    152                 info_thread(L) ** i;
     163                info_thread(L) * i;
    153164        };
    154165
Note: See TracChangeset for help on using the changeset viewer.