uexblock Kernel Service
Purpose
Makes the currently active kernel thread nonrunnable when called from a user-mode exception handler.
Syntax
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/except.h>
Parameter
| Item | Description |
|---|---|
| tid | Specifies the thread ID of the currently active kernel thread to be put into a wait state. |
Description
The uexblock kernel service puts the currently active
kernel thread that is specified by the tid parameter into a wait state until the
uexclear kernel service is used to make
the thread runnable again. If the uexblock kernel service is called from the
process environment, the tid parameter must specify the current active thread;
otherwise the system crashes with a kernel panic.
The uexblock kernel service can be used to lazily control
user-mode
threads access to a shared serially usable resource. Multiple threads can use a serially used
resource, but only one process at a time. When a thread attempts to but cannot access the resource,
a user-mode exception can be set up to occur. This gives control to an exception handler registered
by the uexadd kernel service. This exception
handler can then block the thread by using the uexblock kernel service until the
resource is made available. At this time, the uexclear kernel service can be used
to make the blocked thread runnable.
Execution Environment
The uexblock kernel service can be called from either the process or interrupt environment.
Return Values
The uexblock service has no return values.