Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/iofunc_attr_trylock.html on line 1
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/iofunc_attr_trylock.html on line 1
Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/iofunc_attr_trylock.html on line 8
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/iofunc_attr_trylock.html on line 8
Try to lock the attribute structure
#include <sys/iofunc.h>
int iofunc_attr_trylock( iofunc_attr_t *attr );
- attr
- A pointer to the
iofunc_attr_t
structure that you want to lock.
libc
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.
Call this function (or
iofunc_attr_lock())
before you make
any modifications to the attribute structure.
After you're finished making modifications,
call
iofunc_attr_unlock()
to
release the lock.
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.
- EOK
- Success.
- EBUSY
- The calling thread couldn't lock the attributes immediately.
- EAGAIN
- On the first use, all kernel mutex objects were in use.
QNX Neutrino
Safety: | |
Cancellation point |
Yes |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |
iofunc_attr_init(),
iofunc_attr_lock(),
iofunc_attr_t,
iofunc_attr_unlock()
Writing a Resource Manager
Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/iofunc_attr_trylock.html on line 153
Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/iofunc_attr_trylock.html on line 153