Changes in src/libcfa/bits/locks.h [b158d8f:c2b9f21]
- File:
-
- 1 edited
-
src/libcfa/bits/locks.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/bits/locks.h
rb158d8f rc2b9f21 9 9 // Author : Thierry Delisle 10 10 // Created On : Tue Oct 31 15:14:38 2017 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Dec 8 16:02:22 201713 // Update Count : 111 // Last Modified By : -- 12 // Last Modified On : -- 13 // Update Count : 0 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" : : : )28 26 #else 29 27 #error unsupported architecture 30 28 #endif 31 29 32 #if defined( __i386 ) || defined( __x86_64 ) || defined( __ARM_ARCH )30 #if defined( __i386 ) || defined( __x86_64 ) 33 31 // Intel recommendation 34 32 #define __ALIGN__ __attribute__(( aligned (128) )) … … 39 37 #endif 40 38 41 #if __SIZEOF_SIZE_T__ == 839 #if defined( __x86_64 ) 42 40 #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_8( &(lock), 1 ) == 0 43 41 #define __lock_release( lock ) __sync_lock_release_8( &(lock) ); 44 #elif __SIZEOF_SIZE_T__ == 442 #elif defined( __i386 ) 45 43 #define __lock_test_and_test_and_set( lock ) (lock) == 0 && __sync_lock_test_and_set_4( &(lock), 1 ) == 0 46 44 #define __lock_release( lock ) __sync_lock_release_4( &(lock) ); … … 50 48 51 49 struct __spinlock_t { 52 __ALIGN__ volatile size_t lock;50 __ALIGN__ volatile uintptr_t lock; 53 51 #ifdef __CFA_DEBUG__ 54 52 const char * prev_name;
Note:
See TracChangeset
for help on using the changeset viewer.