Ignore:
Timestamp:
Jun 19, 2020, 3:49:43 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
68f36f4
Parents:
04b5cef
Message:

Fixed idle sleep to no-longer use a spinlock, broke registration and gdbtools in the process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/containers/stackLockFree.hfa

    r04b5cef r64a7146  
    3232
    3333forall( otype T | { Link(T) * getNext( T * ); } ) {
    34     struct StackLF {
     34        struct StackLF {
    3535                Link(T) stack;
    3636        }; // StackLF
     
    5656                        } // for
    5757                } // pop
     58
     59                bool unsafe_remove( StackLF(T) & this, T * node ) with(this) {
     60                        Link(T) * link = &stack;
     61                        for() {
     62                                T * next = link->top;
     63                                if( next == node ) {
     64                                        link->top = getNext( node )->top;
     65                                        return true;
     66                                }
     67                                if( next == 0p ) return false;
     68                                link = getNext(next);
     69                        }
     70                }
    5871        } // distribution
    5972} // distribution
Note: See TracChangeset for help on using the changeset viewer.