Ignore:
Timestamp:
Nov 2, 2017, 5:59:12 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
59a0bde
Parents:
513daec
Message:

Used fast_int in more data structure and started using tuple assign

File:
1 edited

Legend:

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

    r513daec rc1a9c86  
    296296
    297297        // Save previous thread context
    298         this.prev_mntrs = this_thread->monitors.list;
    299         this.prev_count = this_thread->monitors.size;
    300         this.prev_func  = this_thread->monitors.func;
     298        this.[prev_mntrs, prev_count, prev_func] = this_thread->monitors.[list, size, func];
    301299
    302300        // Update thread context (needed for conditions)
    303         this_thread->monitors.list = m;
    304         this_thread->monitors.size = count;
    305         this_thread->monitors.func = func;
     301        this_thread->monitors.[list, size, func] = [m, count, func];
    306302
    307303        // LIB_DEBUG_PRINT_SAFE("MGUARD : enter %d\n", count);
     
    325321
    326322        // Restore thread context
    327         this_thread->monitors.list = this.prev_mntrs;
    328         this_thread->monitors.size = this.prev_count;
    329         this_thread->monitors.func = this.prev_func;
     323        this_thread->monitors.[list, size, func] = this.[prev_mntrs, prev_count, prev_func];
    330324}
    331325
     
    337331
    338332        // Save previous thread context
    339         this.prev_mntrs = this_thread->monitors.list;
    340         this.prev_count = this_thread->monitors.size;
    341         this.prev_func  = this_thread->monitors.func;
     333        this.[prev_mntrs, prev_count, prev_func] = this_thread->monitors.[list, size, func];
    342334
    343335        // Update thread context (needed for conditions)
    344         this_thread->monitors.list = m;
    345         this_thread->monitors.size = 1;
    346         this_thread->monitors.func = func;
     336        this_thread->monitors.[list, size, func] = [m, 1, func];
    347337
    348338        __enter_monitor_dtor( this.m, func );
     
    355345
    356346        // Restore thread context
    357         this_thread->monitors.list = this.prev_mntrs;
    358         this_thread->monitors.size = this.prev_count;
    359         this_thread->monitors.func = this.prev_func;
     347        this_thread->monitors.[list, size, func] = this.[prev_mntrs, prev_count, prev_func];
    360348}
    361349
Note: See TracChangeset for help on using the changeset viewer.