Changeset 22b7579 for libcfa/src/bits


Ignore:
Timestamp:
Mar 31, 2021, 1:48:15 PM (4 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:
c7c178b
Parents:
f621e43f
Message:

Changed is_blocking_lock trait to use on_wakeup.
Fixed fast_lock to work with conditions.

Location:
libcfa/src/bits
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/weakso_locks.cfa

    rf621e43f r22b7579  
    1818#include "bits/weakso_locks.hfa"
    1919
    20 void  ?{}( blocking_lock & this, bool multi_acquisition, bool strict_owner ) {}
    21 void ^?{}( blocking_lock & this ) {}
     20void  ?{}( blocking_lock &, bool, bool ) {}
     21void ^?{}( blocking_lock & ) {}
    2222
    23 void lock( blocking_lock & this ) {}
    24 bool try_lock( blocking_lock & this ) { return false; }
    25 void unlock( blocking_lock & this ) {}
    26 void on_notify( blocking_lock & this, struct $thread * t ) {}
    27 void on_wait( blocking_lock & this ) {}
    28 size_t wait_count( blocking_lock & this ) { return 0; }
    29 void set_recursion_count( blocking_lock & this, size_t recursion ) {}
    30 size_t get_recursion_count( blocking_lock & this ) { return 0; }
     23void lock( blocking_lock & ) {}
     24bool try_lock( blocking_lock & ) { return false; }
     25void unlock( blocking_lock & ) {}
     26void on_notify( blocking_lock &, struct $thread * ) {}
     27size_t on_wait( blocking_lock & ) {}
     28void on_wakeup( blocking_lock &, size_t ) {}
     29size_t wait_count( blocking_lock & ) { return 0; }
  • libcfa/src/bits/weakso_locks.hfa

    rf621e43f r22b7579  
    5656void unlock( blocking_lock & this ) OPTIONAL_THREAD;
    5757void on_notify( blocking_lock & this, struct $thread * t ) OPTIONAL_THREAD;
    58 void on_wait( blocking_lock & this ) OPTIONAL_THREAD;
     58size_t on_wait( blocking_lock & this ) OPTIONAL_THREAD;
     59void on_wakeup( blocking_lock & this, size_t ) OPTIONAL_THREAD;
    5960size_t wait_count( blocking_lock & this ) OPTIONAL_THREAD;
    60 void set_recursion_count( blocking_lock & this, size_t recursion ) OPTIONAL_THREAD;
    61 size_t get_recursion_count( blocking_lock & this ) OPTIONAL_THREAD;
    6261
    6362//----------
     
    7271static inline bool   try_lock ( multiple_acquisition_lock & this ) { return try_lock( (blocking_lock &)this ); }
    7372static inline void   unlock   ( multiple_acquisition_lock & this ) { unlock  ( (blocking_lock &)this ); }
    74 static inline void   on_wait  ( multiple_acquisition_lock & this ) { on_wait ( (blocking_lock &)this ); }
     73static inline size_t on_wait  ( multiple_acquisition_lock & this ) { return on_wait ( (blocking_lock &)this ); }
     74static inline void   on_wakeup( multiple_acquisition_lock & this, size_t v ) { on_wakeup ( (blocking_lock &)this, v ); }
    7575static inline void   on_notify( multiple_acquisition_lock & this, struct $thread * t ){ on_notify( (blocking_lock &)this, t ); }
    76 static inline void   set_recursion_count( multiple_acquisition_lock & this, size_t recursion ){ set_recursion_count( (blocking_lock &)this, recursion ); }
    77 static inline size_t get_recursion_count( multiple_acquisition_lock & this ){ return get_recursion_count( (blocking_lock &)this ); }
Note: See TracChangeset for help on using the changeset viewer.