lock_write - Asserts a complex lock with write access
lock_t lock_structptr );
Specifies a pointer to the complex lock structure, lock.
This is the lock structure associated with the resource on
which you want to assert a complex lock with write access.
The lock structure is an opaque data structure; that is,
its associated members are referenced and manipulated by
the operating system and not by the user of the complex
The lock_write routine asserts a lock with exclusive write
access for the resource associated with the specified lock
structure pointer. This means that once a write lock is
asserted, no other kernel thread can gain read or write
access to the resource until it is released.
To release a complex write lock successfully asserted by
lock_write, call the lock_done routine.
You must call lock_init (once only) prior to calling
lock_write to initialize the lock structure pointer for
the resource. A resource, from the kernel module's standpoint,
is data that more than one kernel thread can manipulate.
You can store the resource in global variables and
in data structure members.
Routines: lock_done(9r), lock_read(9r), lock_terminate(9r), lock_try_read(9r), lock_try_write(9r)
Data Structures: lock(9s)
[ Back ]