Changeset e6e250d for libcfa/src


Ignore:
Timestamp:
Mar 29, 2026, 11:03:25 PM (4 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Parents:
81ab5eb
Message:

3rd attempt at harmonizing isOp functions, e.g., isListed, isFirst, isLast

Location:
libcfa/src
Files:
6 edited

Legend:

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

    r81ab5eb re6e250d  
    1010// Created On       : Wed Apr 22 18:00:00 2020
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Mar 29 21:20:44 2026
    13 // Update Count     : 101
     12// Last Modified On : Sun Mar 29 22:59:08 2026
     13// Update Count     : 104
    1414//
    1515
     
    188188
    189189static inline forall( tE &, tLinks & | embedded( tE, tLinks, dlink( tE ) ) ) {
    190         bool isListed( tE & node ) {
     190        bool listed( tE & node ) {
    191191          NOLOOSE(
    192192                verify( &node != 0p );
     
    195195          )
    196196          LOOSEONLY(
    197                 verify(false && "isListed is undefined");
     197                verify(false && "listed is undefined");
    198198                return true;
    199199          )
     
    204204                if ( ORIGIN_TAG_QUERY(( size_t)firstPtr) ) firstPtr = 0p;
    205205                return firstPtr == 0p;
    206         }
    207 
    208         bool isEmpty( dlist( tE, tLinks ) & list ) {            // deprecated
    209                 return empty( list );
    210206        }
    211207
     
    339335        }
    340336
    341         bool isFirst( tE & node ) {
     337        bool first( tE & node ) {
    342338                return recede( node );
    343339        }
    344340
    345         bool isLast( tE & node ) {
     341        bool last( tE & node ) {
    346342                return advance( node );
    347343    }
  • libcfa/src/collections/list2.hfa

    r81ab5eb re6e250d  
    1919// Created On       : Wed Apr 22 18:00:00 2020
    2020// Last Modified By : Peter A. Buhr
    21 // Last Modified On : Sun Mar 29 21:47:53 2026
    22 // Update Count     : 12
     21// Last Modified On : Sun Mar 29 22:59:31 2026
     22// Update Count     : 15
    2323//
    2424
     
    454454        }
    455455
    456         static inline bool isEmpty( dlist(tE, tLinks) & list ) __attribute__ ((deprecated));
    457         static inline bool isEmpty( dlist(tE, tLinks) & list ) {
    458                 return empty( list );
    459         }
    460 
    461         static inline bool isListed( tE & e ) {
     456        static inline bool listed( tE & e ) {
    462457          NOLOOSE(
    463458                verify (&e != 0p);
     
    469464          )
    470465          LOOSEONLY(
    471                 verify(false && "isListed is undefined");
     466                verify(false && "listed is undefined");
    472467                return true;
    473468          )
     
    516511        }
    517512
    518         bool isFirst( tE & node ) {
     513        bool first( tE & node ) {
    519514                // Probable bug copied from master
    520515                // should be `! recede(node)`
     
    524519        }
    525520
    526         bool isLast( tE & node ) {
     521        bool last( tE & node ) {
    527522                // ditto, vice versa
    528523                return advance( node );
  • libcfa/src/concurrency/channel.hfa

    r81ab5eb re6e250d  
    369369        ///////////////////////////////////////////////////////////////////////////////////////////
    370370        bool unregister_chan( channel(T) & chan, select_node & node ) with(chan) {
    371             if ( ! isListed( node ) && ! node.park_counter ) return false; // handle special OR case
     371            if ( ! listed( node ) && ! node.park_counter ) return false; // handle special OR case
    372372            lock( mutex_lock );
    373             if ( isListed( node ) ) { // op wasn't performed
     373            if ( listed( node ) ) { // op wasn't performed
    374374                remove( node );
    375375                unlock( mutex_lock );
  • libcfa/src/concurrency/future.hfa

    r81ab5eb re6e250d  
    1010// Created On       : Wed Jan 06 17:33:18 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Mar 29 21:13:04 2026
    13 // Update Count     : 223
     12// Last Modified On : Sun Mar 29 22:47:01 2026
     13// Update Count     : 224
    1414//
    1515
     
    7979
    8080                bool unregister_select$( future(T) & fut, select_node & s ) with( fut ) { // for waituntil statement
    81                   if ( ! isListed( s ) ) return false;
    82                         lock( lock );
    83                         if ( isListed( s ) ) remove( s );
     81                  if ( ! listed( s ) ) return false;
     82                        lock( lock );
     83                        if ( listed( s ) ) remove( s );
    8484                        unlock( lock );
    8585                        return false;
  • libcfa/src/concurrency/locks.cfa

    r81ab5eb re6e250d  
    220220bool unregister_select$( blocking_lock & this, select_node & node ) with(this) {
    221221        lock( lock __cfaabi_dbg_ctx2 );
    222         if ( isListed( node ) ) {
     222        if ( listed( node ) ) {
    223223                remove( node );
    224224                wait_count--;
     
    265265                //      may still be called after a thread has been removed from the queue but
    266266                //      before the alarm is unregistered
    267                 if ( isListed( *info_thd ) ) {                                  // is thread on queue
     267                if ( listed( *info_thd ) ) {                                    // is thread on queue
    268268                        info_thd->signalled = false;
    269269                        // remove this thread O(1)
     
    304304                //      may still be called after a thread has been removed from the queue but
    305305                //      before the alarm is unregistered
    306                 if ( isListed( *info_thd ) ) {                                  // is thread on queue
     306                if ( listed( *info_thd ) ) {                                    // is thread on queue
    307307                        info_thd->signalled = false;
    308308                        // remove this thread O(1)
  • libcfa/src/concurrency/locks.hfa

    r81ab5eb re6e250d  
    1111// Created On       : Thu Jan 21 19:46:50 2021
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Sun Nov 23 22:38:45 2025
    14 // Update Count     : 67
     13// Last Modified On : Sun Mar 29 22:46:39 2026
     14// Update Count     : 68
    1515//
    1616
     
    645645static inline bool unregister_select$( simple_owner_lock & this, select_node & node ) with( this ) {
    646646        lock( lock __cfaabi_dbg_ctx2 );
    647         if ( isListed( node ) ) {
     647        if ( listed( node ) ) {
    648648                remove( node );
    649649                unlock( lock );
Note: See TracChangeset for help on using the changeset viewer.