Changeset 00675ed4
- Timestamp:
- Mar 27, 2026, 8:18:19 AM (4 days ago)
- Branches:
- master
- Children:
- 81ab5eb
- Parents:
- 4226eed
- Location:
- libcfa/src
- Files:
-
- 2 edited
-
collections/list.hfa (modified) (2 diffs)
-
concurrency/locks.cfa (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/collections/list.hfa
r4226eed r00675ed4 10 10 // Created On : Wed Apr 22 18:00:00 2020 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Mar 24 11:25:34202613 // Update Count : 9 812 // Last Modified On : Fri Mar 27 08:02:56 2026 13 // Update Count : 99 14 14 // 15 15 … … 200 200 } 201 201 202 bool isEmpty( dlist( tE, tLinks ) & list ) {202 bool empty( dlist( tE, tLinks ) & list ) { 203 203 tE * firstPtr = list.next; 204 204 if ( ORIGIN_TAG_QUERY(( size_t)firstPtr) ) firstPtr = 0p; 205 205 return firstPtr == 0p; 206 } 207 208 bool isEmpty( dlist( tE, tLinks ) & list ) { 209 return empty( list ); 206 210 } 207 211 -
libcfa/src/concurrency/locks.cfa
r4226eed r00675ed4 347 347 bool notify_one( cond_lock(L) & this ) with( this ) { 348 348 lock( lock __cfaabi_dbg_ctx2 ); 349 bool ret = ! isEmpty( blocked_threads );349 bool ret = ! empty( blocked_threads ); 350 350 process_popped(this, remove_first( blocked_threads )); 351 351 unlock( lock ); … … 355 355 bool notify_all( cond_lock(L) & this ) with(this) { 356 356 lock( lock __cfaabi_dbg_ctx2 ); 357 bool ret = ! isEmpty( blocked_threads );358 while( ! isEmpty( blocked_threads ) ) {357 bool ret = ! empty( blocked_threads ); 358 while( ! empty( blocked_threads ) ) { 359 359 process_popped(this, remove_first( blocked_threads )); 360 360 } … … 364 364 365 365 uintptr_t front( cond_lock(L) & this ) with(this) { 366 return isEmpty( blocked_threads ) ? NULL : first( blocked_threads ).info;366 return empty( blocked_threads ) ? NULL : first( blocked_threads ).info; 367 367 } 368 368 369 369 bool empty( cond_lock(L) & this ) with(this) { 370 370 lock( lock __cfaabi_dbg_ctx2 ); 371 bool ret = isEmpty( blocked_threads );371 bool ret = empty( blocked_threads ); 372 372 unlock( lock ); 373 373 return ret; … … 455 455 456 456 bool notify_one( fast_cond_var(L) & this ) with(this) { 457 bool ret = ! isEmpty( blocked_threads );457 bool ret = ! empty( blocked_threads ); 458 458 if ( ret ) { 459 459 info_thread(L) & popped = remove_first( blocked_threads ); … … 463 463 } 464 464 bool notify_all( fast_cond_var(L) & this ) with(this) { 465 bool ret = ! isEmpty( blocked_threads );466 while( ! isEmpty( blocked_threads ) ) {465 bool ret = ! empty( blocked_threads ); 466 while( ! empty( blocked_threads ) ) { 467 467 info_thread(L) & popped = remove_first( blocked_threads ); 468 468 on_notify(*popped.lock, popped.t); … … 471 471 } 472 472 473 uintptr_t front( fast_cond_var(L) & this ) with(this) { return isEmpty( blocked_threads ) ? NULL : first( blocked_threads ).info; }474 bool empty ( fast_cond_var(L) & this ) with(this) { return isEmpty( blocked_threads ); }473 uintptr_t front( fast_cond_var(L) & this ) with(this) { return empty( blocked_threads ) ? NULL : first( blocked_threads ).info; } 474 bool empty ( fast_cond_var(L) & this ) with(this) { return empty( blocked_threads ); } 475 475 476 476 void wait( fast_cond_var(L) & this, L & l ) { … … 503 503 bool notify_one( pthread_cond_var(L) & this ) with(this) { 504 504 lock( lock __cfaabi_dbg_ctx2 ); 505 bool ret = ! isEmpty( blocked_threads );505 bool ret = ! empty( blocked_threads ); 506 506 if ( ret ) { 507 507 info_thread(L) & popped = remove_first( blocked_threads ); … … 515 515 bool notify_all( pthread_cond_var(L) & this ) with(this) { 516 516 lock( lock __cfaabi_dbg_ctx2 ); 517 bool ret = ! isEmpty( blocked_threads );518 while( ! isEmpty( blocked_threads ) ) {517 bool ret = ! empty( blocked_threads ); 518 while( ! empty( blocked_threads ) ) { 519 519 info_thread(L) & popped = remove_first( blocked_threads ); 520 520 popped.signalled = true; … … 525 525 } 526 526 527 uintptr_t front( pthread_cond_var(L) & this ) with(this) { return isEmpty( blocked_threads ) ? NULL : first( blocked_threads ).info; }528 bool empty ( pthread_cond_var(L) & this ) with(this) { return isEmpty( blocked_threads ); }527 uintptr_t front( pthread_cond_var(L) & this ) with(this) { return empty( blocked_threads ) ? NULL : first( blocked_threads ).info; } 528 bool empty ( pthread_cond_var(L) & this ) with(this) { return empty( blocked_threads ); } 529 529 530 530 static void queue_info_thread_timeout( pthread_cond_var(L) & this, info_thread(L) & info, Duration t, Alarm_Callback callback ) with(this) {
Note:
See TracChangeset
for help on using the changeset viewer.