| 2495 | #if ( INCLUDE_vTaskSuspend == 1 ) |
| 2496 | |
| 2497 | void vTaskResume( TaskHandle_t xTaskToResume ) |
| 2498 | { |
| 2499 | TCB_t * const pxTCB = xTaskToResume; |
| 2500 | |
| 2501 | /* It does not make sense to resume the calling task. */ |
| 2502 | configASSERT( xTaskToResume ); |
| 2503 | |
| 2504 | /* The parameter cannot be NULL as it is impossible to resume the |
| 2505 | * currently executing task. It is also impossible to resume a task |
| 2506 | * that is actively running on another core but it is too dangerous |
| 2507 | * to check their run state here. Safer to get into a critical section |
| 2508 | * and check if it is actually suspended or not below. */ |
| 2509 | if( pxTCB != NULL ) |
| 2510 | { |
| 2511 | taskENTER_CRITICAL(); |
| 2512 | { |
| 2513 | if( prvTaskIsTaskSuspended( pxTCB ) != pdFALSE ) |
| 2514 | { |
| 2515 | traceTASK_RESUME( pxTCB ); |
| 2516 | |
| 2517 | /* The ready list can be accessed even if the scheduler is |
| 2518 | * suspended because this is inside a critical section. */ |
| 2519 | ( void ) uxListRemove( &( pxTCB->xStateListItem ) ); |
| 2520 | prvAddTaskToReadyList( pxTCB ); |
| 2521 | |
| 2522 | /* A higher priority task may have just been resumed. */ |
| 2523 | #if ( configUSE_PREEMPTION == 1 ) |
| 2524 | { |
| 2525 | prvYieldForTask( pxTCB, pdTRUE ); |
| 2526 | } |
| 2527 | #endif |
| 2528 | } |
| 2529 | else |
| 2530 | { |
| 2531 | mtCOVERAGE_TEST_MARKER(); |
| 2532 | } |
| 2533 | } |
| 2534 | taskEXIT_CRITICAL(); |
| 2535 | } |
| 2536 | else |
| 2537 | { |
| 2538 | mtCOVERAGE_TEST_MARKER(); |
| 2539 | } |
| 2540 | } |
| 2541 | |
| 2542 | #endif /* INCLUDE_vTaskSuspend */ |
| 2543 |
no test coverage detected