- Timestamp:
- May 1, 2017, 6:27:29 PM (8 years ago)
- 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:
- 5544465
- Parents:
- 0428aad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/monitor.c
r0428aad rad1a8dd 130 130 this_thread()->current_monitors = this->prev_mntrs; 131 131 this_thread()->current_monitor_count = this->prev_count; 132 } 133 134 void debug_break() __attribute__(( noinline )) 135 { 136 132 137 } 133 138 … … 171 176 172 177 //Find the next thread(s) to run 173 unsigned short thread_count = count;178 unsigned short thread_count = 0; 174 179 thread_desc * threads[ count ]; 180 for(int i = 0; i < count; i++) { 181 threads[i] = 0; 182 } 183 184 debug_break(); 175 185 176 186 for( int i = 0; i < count; i++) { 177 187 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(); 180 192 181 193 LIB_DEBUG_PRINT_SAFE("Will unblock: "); … … 345 357 346 358 static 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++) { 348 362 if( thrds[i] == val ) return end; 349 363 }
Note: See TracChangeset
for help on using the changeset viewer.