Ignore:
File:
1 edited

Legend:

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

    r9a9ca36 r0d4f954  
    1 #pragma once
    2 
    31#include "bits/algorithm.hfa"
    42#include "bits/defs.hfa"
     
    64//-----------------------------------------------------------------------------
    75// is_lock
    8 forall(L & | sized(L))
    9 trait is_lock {
     6trait is_lock(L & | sized(L)) {
    107        // For acquiring a lock
    118        void lock( L & );
     
    2724    // Sort locks based on address
    2825    __libcfa_small_sort(this.lockarr, count);
     26
     27    // acquire locks in order
     28    // for ( size_t i = 0; i < count; i++ ) {
     29    //     lock(*this.lockarr[i]);
     30    // }
     31}
     32
     33static inline void ^?{}( __mutex_stmt_lock_guard & this ) with(this) {
     34    // for ( size_t i = count; i > 0; i-- ) {
     35    //     unlock(*lockarr[i - 1]);
     36    // }
    2937}
    3038
Note: See TracChangeset for help on using the changeset viewer.