Changeset b158d8f for src/libcfa/bits
- Timestamp:
- Jan 23, 2018, 5:02:46 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- b6838214
- Parents:
- 6ba16fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/bits/locks.h
r6ba16fa rb158d8f 9 9 // Author : Thierry Delisle 10 10 // Created On : Tue Oct 31 15:14:38 2017 11 // Last Modified By : --12 // Last Modified On : --13 // Update Count : 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 8 16:02:22 2017 13 // Update Count : 1 14 14 // 15 15 … … 24 24 #elif defined( __i386 ) || defined( __x86_64 ) 25 25 #define Pause() __asm__ __volatile__ ( "pause" : : : ) 26 #elif defined( __ARM_ARCH ) 27 #define Pause() __asm__ __volatile__ ( "nop" : : : ) 26 28 #else 27 29 #error unsupported architecture 28 30 #endif 29 31 30 #if defined( __i386 ) || defined( __x86_64 ) 32 #if defined( __i386 ) || defined( __x86_64 ) || defined( __ARM_ARCH ) 31 33 // Intel recommendation 32 34 #define __ALIGN__ __attribute__(( aligned (128) )) … … 37 39 #endif 38 40 39 #if defined( __x86_64 )41 #if __SIZEOF_SIZE_T__ == 8 40 42 #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_8( &(lock), 1 ) == 0 41 43 #define __lock_release( lock ) __sync_lock_release_8( &(lock) ); 42 #elif defined( __i386 )44 #elif __SIZEOF_SIZE_T__ == 4 43 45 #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_4( &(lock), 1 ) == 0 44 46 #define __lock_release( lock ) __sync_lock_release_4( &(lock) ); … … 48 50 49 51 struct __spinlock_t { 50 __ALIGN__ volatile uintptr_t lock;52 __ALIGN__ volatile size_t lock; 51 53 #ifdef __CFA_DEBUG__ 52 54 const char * prev_name;
Note: See TracChangeset
for help on using the changeset viewer.