* @brief Lock the system scheduler * * @param plvl Pointer to the object where lock level stores to * * @return rt_err_t * - RT_EOK on success * - -RT_EINVAL if plvl is NULL * * @note This function has both MP version and UP version. */
| 563 | * @note This function has both MP version and UP version. |
| 564 | */ |
| 565 | rt_err_t rt_sched_lock(rt_sched_lock_level_t *plvl) |
| 566 | { |
| 567 | rt_base_t level; |
| 568 | if (!plvl) |
| 569 | return -RT_EINVAL; |
| 570 | |
| 571 | SCHEDULER_LOCK(level); |
| 572 | *plvl = level; |
| 573 | |
| 574 | return RT_EOK; |
| 575 | } |
| 576 | |
| 577 | /** |
| 578 | * @brief Unlock the scheduler and restore the interrupt level |
no outgoing calls
no test coverage detected