Ignore:
Timestamp:
Dec 3, 2020, 4:24:36 PM (11 months ago)
Author:
Colby Alexander Parsons <caparsons@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
4aeaee5, c74e601
Parents:
aeb31b1
Message:

fixed a lot of bugs and integrated new sequence changes

File:
1 edited

Legend:

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

    raeb31b1 rcad1df1  
    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.