Cygdrvmutexlock, Cygdrvmutextrylock, Cyg_drv_mutex_lock – Comtrol eCos User Manual

Page 399: Cyg_drv_mutex_trylock

Advertising
background image

Chapter 18. Device Driver Interface to the Kernel

Level:

Thread

Description:

Destroy the mutex pointed to by the

mutex

argument. The mutex should be unlocked and there should be no

threads waiting to lock it when this call in made.

cyg_drv_mutex_lock

Function:

cyg_bool cyg_drv_mutex_lock( cyg_drv_mutex *mutex )

Arguments:

mutex

- pointer to mutex to lock

Result:

TRUE

it the thread has claimed the lock,

FALSE

otherwise.

Level:

Thread

Description:

Attempt to lock the mutex pointed to by the

mutex

argument. If the mutex is already locked by another

thread then this thread will wait until that thread is finished. If the result from this function is

FALSE

then the

thread was broken out of its wait by some other thread. In this case the mutex will not have been locked.

cyg_drv_mutex_trylock

Function:

cyg_bool cyg_drv_mutex_trylock( cyg_drv_mutex *mutex )

Arguments:

mutex

- pointer to mutex to lock

Result:

TRUE

if the mutex has been locked,

FALSE

otherwise.

Level:

Thread

295

Advertising