* @brief This function will try to take a semaphore, if the semaphore is unavailable, the thread returns immediately. * * @note This function is very similar to the rt_sem_take() function, when the semaphore is not available, * the rt_sem_trytake() function will return immediately without waiting for a timeout. * In other words, rt_sem_trytake(sem) has the same effec
| 675 | * If the return value is any other values, it means that the semaphore take failed. |
| 676 | */ |
| 677 | rt_err_t rt_sem_trytake(rt_sem_t sem) |
| 678 | { |
| 679 | return rt_sem_take(sem, RT_WAITING_NO); |
| 680 | } |
| 681 | RTM_EXPORT(rt_sem_trytake); |
| 682 | |
| 683 |