Try to lock the attribute structure
#include <sys/iofunc.h> int iofunc_attr_trylock( iofunc_attr_t *attr );
- A pointer to the iofunc_attr_t structure that you want to lock.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The iofunc_attr_trylock() function attempts to lock the attribute structure attr, preventing other threads in the resource manager from changing information. If it can't lock attr immediately, it returns EBUSY.
Note that this is a counting locking mechanism. This means that a given thread can lock the attributes structure multiple times; it must then unlock the attributes structure a corresponding number of times in order to have the attributes structure considered unlocked. If another thread attempts to lock the structure while a thread has the structure locked, the other thread will block.
- The calling thread couldn't lock the attributes immediately.
- On the first use, all kernel mutex objects were in use.