Ignore:
File:
1 edited

Legend:

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

    r4aeaee5 r6a8882c  
    55#include "bits/algorithm.hfa"
    66#include "bits/locks.hfa"
    7 #include "bits/sequence.hfa"
    87#include "bits/containers.hfa"
    98
     
    3231forall(dtype L | is_blocking_lock(L)) {
    3332        struct info_thread {
    34                 inline Seqable;
    3533                struct $thread * t;
    3634                uintptr_t info;
     35                info_thread(L) * next;
    3736                L * lock;
    3837                bool listed;                                    // true if info_thread is on queue, false otherwise;
     
    4342        void ?{}( info_thread(L) & this, $thread * t, uintptr_t info );
    4443        void ^?{}( info_thread(L) & this );
     44
     45        info_thread(L) *& get_next( info_thread(L) & this );
    4546}
    4647
     
    4950///////////////////////////////////////////////////////////////////
    5051
    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 
    6152struct blocking_lock {
    6253        // Spin lock used for mutual exclusion
     
    6455
    6556        // List of blocked threads
    66         __queue_t( $thread ) blocked_threads;
     57        __queue_t( struct $thread ) blocked_threads;
    6758
    6859        // Count of current blocked threads
     
    144135                __spinlock_t lock;
    145136
    146                 info_thread(L) * last_thread;
    147 
    148137                // List of blocked threads
    149                 Sequence( info_thread(L) ) blocked_threads;
     138                __queue_t( info_thread(L) ) blocked_threads;
    150139
    151140                // Count of current blocked threads
     
    161150                condition_variable(L) * cond;
    162151
    163                 info_thread(L) * i;
     152                info_thread(L) ** i;
    164153        };
    165154
    166         void ?{}( alarm_node_wrap(L) & this, Time alarm, Duration period, Alarm_Callback callback );
     155        void ?{}( alarm_node_wrap(L) & this, $thread * thrd, Time alarm, Duration period, Alarm_Callback callback );
    167156        void ^?{}( alarm_node_wrap(L) & this );
    168157
Note: See TracChangeset for help on using the changeset viewer.