iofunc_attr_lock()

Заблокировать атрибутную запись

Прототип:

#include <sys/iofunc.h>
int iofunc_attr_lock( iofunc_attr_t *attr );

Аргументы:

attr
A pointer to the iofunc_attr_t structure that you want to lock.

Библиотека:

libc

Описание:

The iofunc_attr_lock() function locks the attribute structure that attr points to, preventing other threads in the resource manager from changing information.

Call this function (or iofunc_attr_trylock()) 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 blocks.

Возвращаемое значение:

EOK
Успешное завершение.
EAGAIN
On the first use, all kernel mutex objects were in use.

Классификация:

ЗОСРВ «Нейтрино»

Точка остановки потока
Да
Обработчик прерываний
Нет
Обработчик сигналов
Да
В потоке
Да

Тематические ссылки:

iofunc_attr_init(), iofunc_attr_t, iofunc_attr_trylock(), iofunc_attr_unlock()




Предыдущий раздел: Описание API системной библиотеки