MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_sem_trytake

Function rt_sem_trytake

src/ipc.c:677–680  ·  view source on GitHub ↗

* @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

Source from the content-addressed store, hash-verified

675 * If the return value is any other values, it means that the semaphore take failed.
676 */
677rt_err_t rt_sem_trytake(rt_sem_t sem)
678{
679 return rt_sem_take(sem, RT_WAITING_NO);
680}
681RTM_EXPORT(rt_sem_trytake);
682
683

Callers 8

pthread_cond_destroyFunction · 0.85
pthread_cond_broadcastFunction · 0.85
pthread_rwlock_destroyFunction · 0.85
hal_sem_trywaitFunction · 0.85
hpm_lcd_controlFunction · 0.85

Calls 1

rt_sem_takeFunction · 0.85

Tested by 2