Changeset c1a9c86


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

Location:
src/libcfa/concurrency
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/invoke.h

    r513daec rc1a9c86  
    6666        struct coStack_t {
    6767                // size of stack
    68                 unsigned int size;
     68                size_t size;
    6969
    7070                // pointer to stack
     
    8585                // whether or not the user allocated the stack
    8686                bool userStack;
    87 
    8887        };
    8988
     
    118117
    119118                // number of acceptable functions
    120                 short size;
     119                __lock_size_t size;
    121120        };
    122121
     
    149148
    150149                // number of currently held monitors
    151                 short                  size;
     150                __lock_size_t size;
    152151
    153152                // last function that acquired monitors
    154                 fptr_t                 func;
     153                fptr_t func;
    155154        };
    156155
     
    168167                // monitors currently held by this thread
    169168                struct __monitor_group_t monitors;
    170 
    171169
    172170                // Link lists fields
  • src/libcfa/concurrency/monitor

    r513daec rc1a9c86  
    4343        int count;
    4444        monitor_desc ** prev_mntrs;
    45         unsigned short  prev_count;
     45        __lock_size_t   prev_count;
    4646        fptr_t          prev_func;
    4747};
     
    5353        monitor_desc * m;
    5454        monitor_desc ** prev_mntrs;
    55         unsigned short  prev_count;
     55        __lock_size_t   prev_count;
    5656        fptr_t          prev_func;
    5757};
     
    8181        // Intrusive linked list Next field
    8282        __condition_criterion_t * next;
    83 
    8483};
    8584
     
    9291
    9392        // Number of criterions in the criteria
    94         unsigned short count;
     93        __lock_size_t count;
    9594
    9695        // Intrusive linked list Next field
     
    9998        // Custom user info accessible before signalling
    10099        uintptr_t user_info;
    101 
    102100};
    103101
     
    123121
    124122        // Number of monitors in the array
    125         unsigned short monitor_count;
    126 
     123        __lock_size_t monitor_count;
    127124};
    128125
  • 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.