Changeset c366ec6 for src/libcfa


Ignore:
Timestamp:
Oct 10, 2017, 4:29:47 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
d2e2865
Parents:
08da53d (diff), c386bc1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

Location:
src/libcfa/concurrency
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/monitor

    r08da53d rc366ec6  
    1010// Created On       : Thd Feb 23 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 22 09:59:01 2017
    13 // Update Count     : 3
     12// Last Modified On : Sat Oct  7 18:06:45 2017
     13// Update Count     : 10
    1414//
    1515
     
    5454void ^?{}( monitor_guard_t & this );
    5555
    56 
    5756struct monitor_dtor_guard_t {
    5857        monitor_desc * m;
     
    6463void ?{}( monitor_dtor_guard_t & this, monitor_desc ** m, void (*func)() );
    6564void ^?{}( monitor_dtor_guard_t & this );
     65
     66static inline forall( dtype T | sized(T) | { void ^?{}( T & mutex ); } )
     67void delete( T * th ) {
     68        ^(*th){};
     69        free( th );
     70}
    6671
    6772//-----------------------------------------------------------------------------
  • src/libcfa/concurrency/monitor.c

    r08da53d rc366ec6  
    409409        short thread_count = 0;
    410410        thread_desc * threads[ count ];
    411         for(int i = 0; i < count; i++) {
    412                 threads[i] = 0;
    413         }
     411        __builtin_memset( threads, 0, sizeof( threads ) );
    414412
    415413        // Save monitor states
     
    535533        short max = count_max( mask );
    536534        monitor_desc * mon_storage[max];
     535        __builtin_memset( mon_storage, 0, sizeof( mon_storage ) );
    537536        short actual_count = aggregate( mon_storage, mask );
     537
     538        LIB_DEBUG_PRINT_SAFE("Kernel : waitfor %d (s: %d, m: %d)\n", actual_count, mask.size, (short)max);
    538539
    539540        if(actual_count == 0) return;
Note: See TracChangeset for help on using the changeset viewer.