Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/monitor.cfa

    r2026bb6 r09f357ec  
    1010// Created On       : Thd Feb 23 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 30 14:30:26 2018
    13 // Update Count     : 9
     12// Last Modified On : Wed Dec  4 07:55:14 2019
     13// Update Count     : 10
    1414//
    1515
     
    243243        // last routine called by a thread.
    244244        // Should never return
    245         void __leave_thread_monitor( thread_desc * thrd ) {
     245        void __leave_thread_monitor() {
     246                thread_desc * thrd = TL_GET( this_thread );
    246247                monitor_desc * this = &thrd->self_mon;
    247248
     
    363364        this.waiting_thread = waiting_thread;
    364365        this.count = count;
    365         this.next = NULL;
     366        this.next = 0p;
    366367        this.user_info = user_info;
    367368}
     
    369370void ?{}(__condition_criterion_t & this ) with( this ) {
    370371        ready  = false;
    371         target = NULL;
    372         owner  = NULL;
    373         next   = NULL;
     372        target = 0p;
     373        owner  = 0p;
     374        next   = 0p;
    374375}
    375376
     
    378379        this.target = target;
    379380        this.owner  = &owner;
    380         this.next   = NULL;
     381        this.next   = 0p;
    381382}
    382383
     
    387388
    388389        // Check that everything is as expected
    389         assertf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors );
     390        assertf( this.monitors != 0p, "Waiting with no monitors (%p)", this.monitors );
    390391        verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );
    391392        verifyf( this.monitor_count < 32u, "Excessive monitor count (%"PRIiFAST16")", this.monitor_count );
     
    449450
    450451        // Lock all monitors
    451         lock_all( this.monitors, NULL, count );
     452        lock_all( this.monitors, 0p, count );
    452453
    453454        //Pop the head of the waiting queue
     
    471472
    472473        //Check that everything is as expected
    473         verifyf( this.monitors != NULL, "Waiting with no monitors (%p)", this.monitors );
     474        verifyf( this.monitors != 0p, "Waiting with no monitors (%p)", this.monitors );
    474475        verifyf( this.monitor_count != 0, "Waiting with 0 monitors (%"PRIiFAST16")", this.monitor_count );
    475476
     
    674675
    675676static inline void reset_mask( monitor_desc * this ) {
    676         this->mask.accepted = NULL;
    677         this->mask.data = NULL;
     677        this->mask.accepted = 0p;
     678        this->mask.data = 0p;
    678679        this->mask.size = 0;
    679680}
     
    816817        }
    817818
    818         __cfaabi_dbg_print_safe( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : NULL );
    819         return ready2run ? node->waiting_thread : NULL;
     819        __cfaabi_dbg_print_safe( "Kernel :  Runing %i (%p)\n", ready2run, ready2run ? node->waiting_thread : 0p );
     820        return ready2run ? node->waiting_thread : 0p;
    820821}
    821822
     
    824825        if( !this.monitors ) {
    825826                // __cfaabi_dbg_print_safe( "Branding\n" );
    826                 assertf( thrd->monitors.data != NULL, "No current monitor to brand condition %p", thrd->monitors.data );
     827                assertf( thrd->monitors.data != 0p, "No current monitor to brand condition %p", thrd->monitors.data );
    827828                this.monitor_count = thrd->monitors.size;
    828829
Note: See TracChangeset for help on using the changeset viewer.