| 
            Last change
 on this file since afb3d68 was             beeff61e, checked in by caparsons <caparson@…>, 3 years ago           | 
        
        
          | 
             
some cleanup and a bunch of changes to support waituntil statement 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            846 bytes
           | 
        
      
      
| Rev | Line |   | 
|---|
| [5e4a830] | 1 | #pragma once
 | 
|---|
 | 2 | 
 | 
|---|
| [1b97976c] | 3 | #include "bits/algorithm.hfa"
 | 
|---|
| [eb9c2dc] | 4 | #include "bits/defs.hfa"
 | 
|---|
| [1b97976c] | 5 | 
 | 
|---|
 | 6 | //-----------------------------------------------------------------------------
 | 
|---|
 | 7 | // is_lock
 | 
|---|
| [dd3576b] | 8 | forall(L & | sized(L))
 | 
|---|
 | 9 | trait is_lock {
 | 
|---|
| [1b97976c] | 10 |         // For acquiring a lock
 | 
|---|
 | 11 |         void lock( L & );
 | 
|---|
 | 12 | 
 | 
|---|
 | 13 |         // For releasing a lock
 | 
|---|
 | 14 |         void unlock( L & );
 | 
|---|
 | 15 | };
 | 
|---|
 | 16 | 
 | 
|---|
| [0d4f954] | 17 | struct __mutex_stmt_lock_guard {
 | 
|---|
 | 18 |     void ** lockarr;
 | 
|---|
 | 19 |     __lock_size_t count;
 | 
|---|
 | 20 | };
 | 
|---|
| [1b97976c] | 21 | 
 | 
|---|
| [0d4f954] | 22 | static inline void ?{}( __mutex_stmt_lock_guard & this, void * lockarr [], __lock_size_t count  ) {
 | 
|---|
 | 23 |     this.lockarr = lockarr;
 | 
|---|
 | 24 |     this.count = count;
 | 
|---|
| [1b97976c] | 25 | 
 | 
|---|
| [0d4f954] | 26 |     // Sort locks based on address
 | 
|---|
 | 27 |     __libcfa_small_sort(this.lockarr, count);
 | 
|---|
 | 28 | }
 | 
|---|
 | 29 | 
 | 
|---|
 | 30 | forall(L & | is_lock(L)) {
 | 
|---|
| [beeff61e] | 31 |     static inline void * __get_mutexstmt_lock_ptr( L & this ) { return &this; }
 | 
|---|
 | 32 |     static inline L __get_mutexstmt_lock_type( L & this ) {}
 | 
|---|
 | 33 |     static inline L __get_mutexstmt_lock_type( L * this ) {}
 | 
|---|
| [dd3576b] | 34 | }
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.