Changes in libcfa/src/bits/locks.hfa [e235429:a77496cb]
- File:
-
- 1 edited
-
libcfa/src/bits/locks.hfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/locks.hfa
re235429 ra77496cb 164 164 165 165 struct $thread; 166 extern void park( void);167 extern void unpark( struct $thread * this );166 extern void park( __cfaabi_dbg_ctx_param ); 167 extern void unpark( struct $thread * this __cfaabi_dbg_ctx_param2 ); 168 168 static inline struct $thread * active_thread (); 169 169 … … 191 191 /* paranoid */ verify( expected == 0p ); 192 192 if(__atomic_compare_exchange_n(&this.ptr, &expected, active_thread(), false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) { 193 park( );193 park( __cfaabi_dbg_ctx ); 194 194 return true; 195 195 } … … 210 210 else { 211 211 if(__atomic_compare_exchange_n(&this.ptr, &expected, 0p, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) { 212 unpark( expected );212 unpark( expected __cfaabi_dbg_ctx2 ); 213 213 return true; 214 214 } … … 244 244 /* paranoid */ verify( expected == 0p ); 245 245 if(__atomic_compare_exchange_n(&this.ptr, &expected, active_thread(), false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) { 246 park( );246 park( __cfaabi_dbg_ctx ); 247 247 /* paranoid */ verify( this.ptr == 1p ); 248 248 return true; … … 256 256 struct $thread * got = __atomic_exchange_n( &this.ptr, 1p, __ATOMIC_SEQ_CST); 257 257 if( got == 0p ) return false; 258 unpark( got );258 unpark( got __cfaabi_dbg_ctx2 ); 259 259 return true; 260 260 } … … 357 357 struct oneshot * expected = this.ptr; 358 358 // was this abandoned? 359 #if defined(__GNUC__) && __GNUC__ >= 7 360 #pragma GCC diagnostic push 361 #pragma GCC diagnostic ignored "-Wfree-nonheap-object" 362 #endif 363 if( expected == 3p ) { free( &this ); return false; } 364 #if defined(__GNUC__) && __GNUC__ >= 7 365 #pragma GCC diagnostic pop 366 #endif 359 if( expected == 3p ) { free( &this ); return false; } 367 360 368 361 /* paranoid */ verify( expected != 1p ); // Future is already fulfilled, should not happen
Note:
See TracChangeset
for help on using the changeset viewer.