Changeset 00675ed4


Ignore:
Timestamp:
Mar 27, 2026, 8:18:19 AM (4 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
81ab5eb
Parents:
4226eed
Message:

1st attempt at harmonizing isOp functions, e.g., isEmpty, to C/C++ form empty

Location:
libcfa/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/collections/list.hfa

    r4226eed r00675ed4  
    1010// Created On       : Wed Apr 22 18:00:00 2020
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar 24 11:25:34 2026
    13 // Update Count     : 98
     12// Last Modified On : Fri Mar 27 08:02:56 2026
     13// Update Count     : 99
    1414//
    1515
     
    200200        }
    201201
    202         bool isEmpty( dlist( tE, tLinks ) & list ) {
     202        bool empty( dlist( tE, tLinks ) & list ) {
    203203                tE * firstPtr = list.next;
    204204                if ( ORIGIN_TAG_QUERY(( size_t)firstPtr) ) firstPtr = 0p;
    205205                return firstPtr == 0p;
     206        }
     207
     208        bool isEmpty( dlist( tE, tLinks ) & list ) {
     209                return empty( list );
    206210        }
    207211
  • libcfa/src/concurrency/locks.cfa

    r4226eed r00675ed4  
    347347        bool notify_one( cond_lock(L) & this ) with( this ) {
    348348                lock( lock __cfaabi_dbg_ctx2 );
    349                 bool ret = ! isEmpty( blocked_threads );
     349                bool ret = ! empty( blocked_threads );
    350350                process_popped(this, remove_first( blocked_threads ));
    351351                unlock( lock );
     
    355355        bool notify_all( cond_lock(L) & this ) with(this) {
    356356                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 ) ) {
    359359                        process_popped(this, remove_first( blocked_threads ));
    360360                }
     
    364364
    365365        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;
    367367        }
    368368
    369369        bool empty( cond_lock(L) & this ) with(this) {
    370370                lock( lock __cfaabi_dbg_ctx2 );
    371                 bool ret = isEmpty( blocked_threads );
     371                bool ret = empty( blocked_threads );
    372372                unlock( lock );
    373373                return ret;
     
    455455
    456456        bool notify_one( fast_cond_var(L) & this ) with(this) {
    457                 bool ret = ! isEmpty( blocked_threads );
     457                bool ret = ! empty( blocked_threads );
    458458                if ( ret ) {
    459459                        info_thread(L) & popped = remove_first( blocked_threads );
     
    463463        }
    464464        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 ) ) {
    467467                        info_thread(L) & popped = remove_first( blocked_threads );
    468468                        on_notify(*popped.lock, popped.t);
     
    471471        }
    472472
    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 ); }
    475475
    476476        void wait( fast_cond_var(L) & this, L & l ) {
     
    503503        bool notify_one( pthread_cond_var(L) & this ) with(this) {
    504504                lock( lock __cfaabi_dbg_ctx2 );
    505                 bool ret = ! isEmpty( blocked_threads );
     505                bool ret = ! empty( blocked_threads );
    506506                if ( ret ) {
    507507                        info_thread(L) & popped = remove_first( blocked_threads );
     
    515515        bool notify_all( pthread_cond_var(L) & this ) with(this) {
    516516                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 ) ) {
    519519                        info_thread(L) & popped = remove_first( blocked_threads );
    520520                        popped.signalled = true;
     
    525525        }
    526526
    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 ); }
    529529
    530530        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.