Changeset ec43cf9 for libcfa/src/concurrency/kernel.cfa
- Timestamp:
- Apr 5, 2021, 7:06:37 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7039ab9, cd59d28
- Parents:
- a5a01faa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
ra5a01faa rec43cf9 357 357 break RUNNING; 358 358 case TICKET_UNBLOCK: 359 #if !defined(__CFA_NO_STATISTICS__) 360 __tls_stats()->ready.threads.threads++; 361 #endif 359 362 // This is case 2, the racy case, someone tried to run this thread before it finished blocking 360 363 // In this case, just run it again. … … 370 373 371 374 __cfadbg_print_safe(runtime_core, "Kernel : core %p finished running thread %p\n", this, thrd_dst); 375 376 #if !defined(__CFA_NO_STATISTICS__) 377 __tls_stats()->ready.threads.threads--; 378 #endif 372 379 373 380 /* paranoid */ verify( ! __preemption_enabled() ); … … 432 439 if (thrd->preempted == __NO_PREEMPTION) thrd->state = Ready; 433 440 441 // Dereference the thread now because once we push it, there is not guaranteed it's still valid. 442 struct cluster * cl = thrd->curr_cluster; 443 434 444 ready_schedule_lock(); 435 // Dereference the thread now because once we push it, there is not guaranteed it's still valid.436 struct cluster * cl = thrd->curr_cluster;437 438 445 // push the thread to the cluster ready-queue 439 446 push( cl, thrd ); … … 444 451 __wake_one( cl ); 445 452 ready_schedule_unlock(); 453 454 #if !defined(__CFA_NO_STATISTICS__) 455 if( kernelTLS().this_stats ) { 456 __tls_stats()->ready.threads.threads++; 457 } 458 else { 459 __atomic_fetch_add(&cl->stats->ready.threads.threads, 1, __ATOMIC_RELAXED); 460 } 461 #endif 446 462 447 463 /* paranoid */ verify( ! __preemption_enabled() );
Note: See TracChangeset
for help on using the changeset viewer.