Changeset cdbab55 for libcfa/src/bits/locks.hfa
- Timestamp:
- Aug 21, 2018, 2:24:29 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- 2a6292d
- Parents:
- 2b79a70 (diff), efa8b6af (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 moved
-
libcfa/src/bits/locks.hfa (moved) (moved from src/libcfa/bits/locks.h ) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/locks.hfa
r2b79a70 rcdbab55 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // bits/locks.h -- Fast internal locks.7 // bits/locks.hfa -- Fast internal locks. 8 8 // 9 9 // Author : Thierry Delisle 10 10 // Created On : Tue Oct 31 15:14:38 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 30 18:18:13201813 // Update Count : 912 // Last Modified On : Sat Aug 11 15:42:24 2018 13 // Update Count : 10 14 14 // 15 15 16 16 #pragma once 17 17 18 #include "bits/debug.h "19 #include "bits/defs.h "18 #include "bits/debug.hfa" 19 #include "bits/defs.hfa" 20 20 #include <assert.h> 21 21 … … 50 50 struct { 51 51 // Align lock on 128-bit boundary 52 __ALIGN__ volatile _Bool lock;52 __ALIGN__ volatile bool lock; 53 53 }; 54 54 #ifdef __CFA_DEBUG__ … … 64 64 extern void disable_interrupts(); 65 65 extern void enable_interrupts_noPoll(); 66 67 #ifdef __CFA_DEBUG__ 68 void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name); 69 #else 70 #define __cfaabi_dbg_record(x, y) 71 #endif 66 72 } 67 73 … … 72 78 } 73 79 74 75 #ifdef __CFA_DEBUG__76 void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name);77 #else78 #define __cfaabi_dbg_record(x, y)79 #endif80 81 80 // Lock the spinlock, return false if already acquired 82 static inline _Bool try_lock ( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) {83 _Bool result = (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0);81 static inline bool try_lock ( __spinlock_t & this __cfaabi_dbg_ctx_param2 ) { 82 bool result = (this.lock == 0) && (__atomic_test_and_set( &this.lock, __ATOMIC_ACQUIRE ) == 0); 84 83 if( result ) { 85 84 disable_interrupts();
Note:
See TracChangeset
for help on using the changeset viewer.