Changeset ad1a8dd


Ignore:
Timestamp:
May 1, 2017, 6:27:29 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
5544465
Parents:
0428aad
Message:

Tentative fix for monitors

File:
1 edited

Legend:

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

    r0428aad rad1a8dd  
    130130        this_thread()->current_monitors      = this->prev_mntrs;
    131131        this_thread()->current_monitor_count = this->prev_count;
     132}
     133
     134void debug_break() __attribute__(( noinline ))
     135{
     136       
    132137}
    133138
     
    171176
    172177        //Find the next thread(s) to run
    173         unsigned short thread_count = count;
     178        unsigned short thread_count = 0;
    174179        thread_desc * threads[ count ];
     180        for(int i = 0; i < count; i++) {
     181                threads[i] = 0;
     182        }
     183
     184        debug_break();
    175185
    176186        for( int i = 0; i < count; i++) {
    177187                thread_desc * new_owner = next_thread( this->monitors[i] );
    178                 thread_count = insert_unique( threads, i, new_owner );
    179         }
     188                thread_count = insert_unique( threads, thread_count, new_owner );
     189        }
     190
     191        debug_break();
    180192
    181193        LIB_DEBUG_PRINT_SAFE("Will unblock: ");
     
    345357
    346358static inline unsigned short insert_unique( thread_desc ** thrds, unsigned short end, thread_desc * val ) {
    347         for(int i = 0; i < end; i++) {
     359        if( !val ) return end;
     360
     361        for(int i = 0; i <= end; i++) {
    348362                if( thrds[i] == val ) return end;
    349363        }
Note: See TracChangeset for help on using the changeset viewer.