_umtx_op(2),thr_*(2): Various spelling, grammar and mdoc fixes.
This commit is contained in:
parent
44f8773834
commit
8e44e0ab19
@ -257,7 +257,7 @@ are defined, in addition to the common flags:
|
|||||||
.It Dv URWLOCK_PREFER_READER
|
.It Dv URWLOCK_PREFER_READER
|
||||||
If specified, immediately grant read lock requests when
|
If specified, immediately grant read lock requests when
|
||||||
.Dv urwlock
|
.Dv urwlock
|
||||||
is already read-locked, even in presence of the unsatisfied write
|
is already read-locked, even in presence of unsatisfied write
|
||||||
lock requests.
|
lock requests.
|
||||||
By default, if there is a write lock waiter, further read requests are
|
By default, if there is a write lock waiter, further read requests are
|
||||||
not granted, to prevent unfair write lock waiter starvation.
|
not granted, to prevent unfair write lock waiter starvation.
|
||||||
@ -387,7 +387,7 @@ variant which returns an error rather than sleeping if the lock cannot
|
|||||||
be obtained.
|
be obtained.
|
||||||
Also,
|
Also,
|
||||||
.Fn _umtx_op
|
.Fn _umtx_op
|
||||||
provides requests which explicitely put the thread to sleep.
|
provides requests which explicitly put the thread to sleep.
|
||||||
.Pp
|
.Pp
|
||||||
Wakes need to know which threads to make runnable, so sleeping threads
|
Wakes need to know which threads to make runnable, so sleeping threads
|
||||||
are grouped into containers called
|
are grouped into containers called
|
||||||
@ -399,12 +399,12 @@ Note that the
|
|||||||
.Em physical
|
.Em physical
|
||||||
address is used, which means that same variable mapped multiple
|
address is used, which means that same variable mapped multiple
|
||||||
times will give one key value.
|
times will give one key value.
|
||||||
This mechanism enables the construction of the
|
This mechanism enables the construction of
|
||||||
.Em process-shared
|
.Em process-shared
|
||||||
locks.
|
locks.
|
||||||
.Pp
|
.Pp
|
||||||
A related attribute of the key is shareability.
|
A related attribute of the key is shareability.
|
||||||
Some requests always interpet keys as private for the current process,
|
Some requests always interpret keys as private for the current process,
|
||||||
creating sleep queues with the scope of the current process even if
|
creating sleep queues with the scope of the current process even if
|
||||||
the memory is shared.
|
the memory is shared.
|
||||||
Others either select the shareability automatically from the
|
Others either select the shareability automatically from the
|
||||||
@ -435,7 +435,8 @@ the queue are selected.
|
|||||||
The
|
The
|
||||||
.Em robust umutexes
|
.Em robust umutexes
|
||||||
are provided as a substrate for a userspace library to implement
|
are provided as a substrate for a userspace library to implement
|
||||||
POSIX robust mutexes.
|
.Tn POSIX
|
||||||
|
robust mutexes.
|
||||||
A robust umutex must have the
|
A robust umutex must have the
|
||||||
.Dv UMUTEX_ROBUST
|
.Dv UMUTEX_ROBUST
|
||||||
flag set.
|
flag set.
|
||||||
@ -524,13 +525,13 @@ argument is compared with the
|
|||||||
If they are equal, the requesting thread is put to interruptible sleep
|
If they are equal, the requesting thread is put to interruptible sleep
|
||||||
until woken up or the optionally specified timeout expires.
|
until woken up or the optionally specified timeout expires.
|
||||||
.Pp
|
.Pp
|
||||||
The comparision and sleep are atomic.
|
The comparison and sleep are atomic.
|
||||||
In other words, if another thread writes a new value to
|
In other words, if another thread writes a new value to
|
||||||
.Dv *obj
|
.Dv *obj
|
||||||
and then issues
|
and then issues
|
||||||
.Dv UMTX_OP_WAKE ,
|
.Dv UMTX_OP_WAKE ,
|
||||||
the request is guaranteed to not miss the wakeup,
|
the request is guaranteed to not miss the wakeup,
|
||||||
which might otherwise happen between comparision and blocking.
|
which might otherwise happen between comparison and blocking.
|
||||||
.Pp
|
.Pp
|
||||||
The physical address of memory where the
|
The physical address of memory where the
|
||||||
.Fa *obj
|
.Fa *obj
|
||||||
@ -599,7 +600,7 @@ contention indicator, and provides the acquire barrier for
|
|||||||
lock entrance semantic.
|
lock entrance semantic.
|
||||||
.Pp
|
.Pp
|
||||||
If the lock cannot be obtained immediately because another thread owns
|
If the lock cannot be obtained immediately because another thread owns
|
||||||
the lock, the current thread is put into sleep, with
|
the lock, the current thread is put to sleep, with
|
||||||
.Dv UMUTEX_CONTESTED
|
.Dv UMUTEX_CONTESTED
|
||||||
bit set before.
|
bit set before.
|
||||||
Upon wake up, the lock conditions are re-tested.
|
Upon wake up, the lock conditions are re-tested.
|
||||||
@ -668,7 +669,9 @@ New ceiling value.
|
|||||||
.It Fa uaddr
|
.It Fa uaddr
|
||||||
Address of a variable of type
|
Address of a variable of type
|
||||||
.Vt uint32_t .
|
.Vt uint32_t .
|
||||||
If not NULL, after the successful update the previous ceiling value is
|
If not
|
||||||
|
.Dv NULL
|
||||||
|
and the update was successful, the previous ceiling value is
|
||||||
written to the location pointed to by
|
written to the location pointed to by
|
||||||
.Fa uaddr .
|
.Fa uaddr .
|
||||||
.El
|
.El
|
||||||
@ -685,7 +688,9 @@ member of the
|
|||||||
after which the umutex is unlocked.
|
after which the umutex is unlocked.
|
||||||
.Pp
|
.Pp
|
||||||
The locking does not adhere to the priority protect protocol,
|
The locking does not adhere to the priority protect protocol,
|
||||||
to confirm with the POSIX requirements for the
|
to conform to the
|
||||||
|
.Tn POSIX
|
||||||
|
requirements for the
|
||||||
.Xr pthread_mutex_setprioceiling 3
|
.Xr pthread_mutex_setprioceiling 3
|
||||||
interface.
|
interface.
|
||||||
.It Dv UMTX_OP_CV_WAIT
|
.It Dv UMTX_OP_CV_WAIT
|
||||||
@ -769,7 +774,8 @@ If the
|
|||||||
flag is supplied, the timeout specifies absolute time value, otherwise
|
flag is supplied, the timeout specifies absolute time value, otherwise
|
||||||
it denotes a relative time interval.
|
it denotes a relative time interval.
|
||||||
.Pp
|
.Pp
|
||||||
The request is not restartable. An unblocked signal delivered during
|
The request is not restartable.
|
||||||
|
An unblocked signal delivered during
|
||||||
the wait always results in sleep interruption and
|
the wait always results in sleep interruption and
|
||||||
.Er EINTR
|
.Er EINTR
|
||||||
error.
|
error.
|
||||||
@ -845,7 +851,7 @@ If the
|
|||||||
.Dv URWLOCK_WRITE_OWNER
|
.Dv URWLOCK_WRITE_OWNER
|
||||||
bit is set in the word
|
bit is set in the word
|
||||||
.Dv rw_state ,
|
.Dv rw_state ,
|
||||||
the lock was granted to a writer which has not yet relinguished
|
the lock was granted to a writer which has not yet relinquished
|
||||||
its ownership.
|
its ownership.
|
||||||
In this case the current thread is put to sleep until it makes sense to
|
In this case the current thread is put to sleep until it makes sense to
|
||||||
retry.
|
retry.
|
||||||
@ -959,7 +965,7 @@ Same as
|
|||||||
.Dv UMTX_OP_WAKE ,
|
.Dv UMTX_OP_WAKE ,
|
||||||
but unconditionally select the process-private sleep queue.
|
but unconditionally select the process-private sleep queue.
|
||||||
.It Dv UMTX_OP_MUTEX_WAIT
|
.It Dv UMTX_OP_MUTEX_WAIT
|
||||||
Wait for the mutex availability.
|
Wait for mutex availability.
|
||||||
The arguments to the request are:
|
The arguments to the request are:
|
||||||
.Bl -tag -width "It Fa obj"
|
.Bl -tag -width "It Fa obj"
|
||||||
.It Fa obj
|
.It Fa obj
|
||||||
@ -986,12 +992,12 @@ priority inherited protocol mutexes.
|
|||||||
Optionally, a timeout for the request may be specified.
|
Optionally, a timeout for the request may be specified.
|
||||||
.Pp
|
.Pp
|
||||||
.Pp
|
.Pp
|
||||||
The request with a timeout specified is not restartable.
|
A request with a timeout specified is not restartable.
|
||||||
An unblocked signal delivered during the wait always results in sleep
|
An unblocked signal delivered during the wait always results in sleep
|
||||||
interruption and
|
interruption and
|
||||||
.Er EINTR
|
.Er EINTR
|
||||||
error.
|
error.
|
||||||
The request without a timeout automatically restarts if the signal disposition
|
A request without a timeout automatically restarts if the signal disposition
|
||||||
requested restart via the
|
requested restart via the
|
||||||
.Dv SA_RESTART
|
.Dv SA_RESTART
|
||||||
flag in
|
flag in
|
||||||
@ -999,7 +1005,7 @@ flag in
|
|||||||
member
|
member
|
||||||
.Dv sa_flags .
|
.Dv sa_flags .
|
||||||
.It Dv UMTX_OP_NWAKE_PRIVATE
|
.It Dv UMTX_OP_NWAKE_PRIVATE
|
||||||
Wake up a batch of sleeping thread.
|
Wake up a batch of sleeping threads.
|
||||||
The arguments to the request are:
|
The arguments to the request are:
|
||||||
.Bl -tag -width "It Fa obj"
|
.Bl -tag -width "It Fa obj"
|
||||||
.It Fa obj
|
.It Fa obj
|
||||||
@ -1016,7 +1022,7 @@ wakes up all threads waiting on the
|
|||||||
sleep queue with the key
|
sleep queue with the key
|
||||||
being the byte addressed by the array element.
|
being the byte addressed by the array element.
|
||||||
.It Dv UMTX_OP_MUTEX_WAKE
|
.It Dv UMTX_OP_MUTEX_WAKE
|
||||||
Check if the normal umutex is unlocked and wake up a waiter.
|
Check if a normal umutex is unlocked and wake up a waiter.
|
||||||
The arguments for the request are:
|
The arguments for the request are:
|
||||||
.Bl -tag -width "It Fa obj"
|
.Bl -tag -width "It Fa obj"
|
||||||
.It Fa obj
|
.It Fa obj
|
||||||
@ -1036,7 +1042,7 @@ if any.
|
|||||||
Only normal mutexes are supported by the request.
|
Only normal mutexes are supported by the request.
|
||||||
The sleep queue is always one for a normal mutex type.
|
The sleep queue is always one for a normal mutex type.
|
||||||
.It Dv UMTX_OP_MUTEX_WAKE2
|
.It Dv UMTX_OP_MUTEX_WAKE2
|
||||||
Check if the umutex is unlocked and wake up a waiter.
|
Check if a umutex is unlocked and wake up a waiter.
|
||||||
The arguments for the request are:
|
The arguments for the request are:
|
||||||
.Bl -tag -width "It Fa obj"
|
.Bl -tag -width "It Fa obj"
|
||||||
.It Fa obj
|
.It Fa obj
|
||||||
@ -1048,7 +1054,7 @@ The umutex flags.
|
|||||||
The request does not read the
|
The request does not read the
|
||||||
.Dv m_flags
|
.Dv m_flags
|
||||||
member of the
|
member of the
|
||||||
.Vt struct umutex ,
|
.Vt struct umutex ;
|
||||||
instead, the
|
instead, the
|
||||||
.Fa val
|
.Fa val
|
||||||
argument supplies flag information, in particular, to determine the
|
argument supplies flag information, in particular, to determine the
|
||||||
@ -1064,8 +1070,7 @@ one waiter but the mutex is owned by a thread, the
|
|||||||
bit is set in the
|
bit is set in the
|
||||||
.Dv m_owner
|
.Dv m_owner
|
||||||
word of the
|
word of the
|
||||||
.Vt struct umutex
|
.Vt struct umutex .
|
||||||
the request operates upon.
|
|
||||||
.It Dv UMTX_OP_SEM2_WAIT
|
.It Dv UMTX_OP_SEM2_WAIT
|
||||||
Wait until semaphore is available.
|
Wait until semaphore is available.
|
||||||
The arguments to the request are:
|
The arguments to the request are:
|
||||||
@ -1076,12 +1081,12 @@ Pointer to the semaphore (of type
|
|||||||
.El
|
.El
|
||||||
Put the requesting thread onto a sleep queue if the semaphore counter
|
Put the requesting thread onto a sleep queue if the semaphore counter
|
||||||
is zero.
|
is zero.
|
||||||
If thread is put to sleep, the
|
If the thread is put to sleep, the
|
||||||
.Dv USEM_HAS_WAITERS
|
.Dv USEM_HAS_WAITERS
|
||||||
bit is set in the
|
bit is set in the
|
||||||
.Dv _count
|
.Dv _count
|
||||||
word to indicate waiters.
|
word to indicate waiters.
|
||||||
Function returns either due to
|
The function returns either due to
|
||||||
.Dv _count
|
.Dv _count
|
||||||
indicating the semaphore is available (non-zero count due to post),
|
indicating the semaphore is available (non-zero count due to post),
|
||||||
or due to a wakeup.
|
or due to a wakeup.
|
||||||
@ -1096,7 +1101,7 @@ interruption and
|
|||||||
.Er EINTR
|
.Er EINTR
|
||||||
error.
|
error.
|
||||||
.It Dv UMTX_OP_SEM2_WAKE
|
.It Dv UMTX_OP_SEM2_WAKE
|
||||||
Wake up waiters on the semaphore lock.
|
Wake up waiters on semaphore lock.
|
||||||
The arguments to the request are:
|
The arguments to the request are:
|
||||||
.Bl -tag -width "It Fa obj"
|
.Bl -tag -width "It Fa obj"
|
||||||
.It Fa obj
|
.It Fa obj
|
||||||
@ -1112,7 +1117,9 @@ bit was set in the
|
|||||||
.Dv _count
|
.Dv _count
|
||||||
word, and the last sleeping thread was woken up, the bit is cleared.
|
word, and the last sleeping thread was woken up, the bit is cleared.
|
||||||
.It Dv UMTX_OP_SHM
|
.It Dv UMTX_OP_SHM
|
||||||
Manage the anonymous POSIX shared objects (see
|
Manage anonymous
|
||||||
|
.Tn POSIX
|
||||||
|
shared memory objects (see
|
||||||
.Xr shm_open 2 ) ,
|
.Xr shm_open 2 ) ,
|
||||||
which can be attached to a byte of physical memory, mapped into the
|
which can be attached to a byte of physical memory, mapped into the
|
||||||
process address space.
|
process address space.
|
||||||
@ -1126,7 +1133,7 @@ argument specifies the sub-request of the
|
|||||||
request:
|
request:
|
||||||
.Bl -tag -width "Dv UMTX_SHM_DESTROY"
|
.Bl -tag -width "Dv UMTX_SHM_DESTROY"
|
||||||
.It Dv UMTX_SHM_CREAT
|
.It Dv UMTX_SHM_CREAT
|
||||||
Creates the POSIX anonymous memory shared object, which can be looked up
|
Creates the anonymous shared memory object, which can be looked up
|
||||||
with the specified key
|
with the specified key
|
||||||
.Fa uaddr.
|
.Fa uaddr.
|
||||||
If the object associated with the
|
If the object associated with the
|
||||||
@ -1143,7 +1150,7 @@ Same as
|
|||||||
request, but if there is no shared memory object associated with
|
request, but if there is no shared memory object associated with
|
||||||
the specified key
|
the specified key
|
||||||
.Fa uaddr ,
|
.Fa uaddr ,
|
||||||
an error is returned, and new object is not created.
|
an error is returned, and no new object is created.
|
||||||
.It Dv UMTX_SHM_DESTROY
|
.It Dv UMTX_SHM_DESTROY
|
||||||
De-associate the shared object with the specified key
|
De-associate the shared object with the specified key
|
||||||
.Fa uaddr.
|
.Fa uaddr.
|
||||||
@ -1158,7 +1165,7 @@ This request is an optimization of the
|
|||||||
.Dv UMTX_SHM_LOOKUP
|
.Dv UMTX_SHM_LOOKUP
|
||||||
request.
|
request.
|
||||||
It is cheaper when only the liveness of the associated object is asked
|
It is cheaper when only the liveness of the associated object is asked
|
||||||
for, since the file descriptor is not installed in the process fd table
|
for, since no file descriptor is installed in the process fd table
|
||||||
on success.
|
on success.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
@ -1212,7 +1219,7 @@ The kernel inspects the
|
|||||||
in addition to walking the shared and private lists.
|
in addition to walking the shared and private lists.
|
||||||
Also, the mutex pointed to by
|
Also, the mutex pointed to by
|
||||||
.Dv robust_inact_offset
|
.Dv robust_inact_offset
|
||||||
is handled more loosly at the thread termination time,
|
is handled more loosely at the thread termination time,
|
||||||
than other mutexes on the list.
|
than other mutexes on the list.
|
||||||
That mutex is allowed to be not owned by the current thread,
|
That mutex is allowed to be not owned by the current thread,
|
||||||
in which case list processing is continued.
|
in which case list processing is continued.
|
||||||
@ -1233,7 +1240,7 @@ The
|
|||||||
.Dv UMTX_SHM_CREAT
|
.Dv UMTX_SHM_CREAT
|
||||||
and
|
and
|
||||||
.Dv UMTX_SHM_LOOKUP
|
.Dv UMTX_SHM_LOOKUP
|
||||||
return a POSIX shared memory file descriptor on success.
|
return a shared memory file descriptor on success.
|
||||||
On error \-1 is returned, and the
|
On error \-1 is returned, and the
|
||||||
.Va errno
|
.Va errno
|
||||||
variable is set to indicate the error.
|
variable is set to indicate the error.
|
||||||
@ -1326,15 +1333,15 @@ and
|
|||||||
.Dv UMTX_SHM_ALIVE
|
.Dv UMTX_SHM_ALIVE
|
||||||
sub-requests of the
|
sub-requests of the
|
||||||
.Dv UMTX_OP_SHM
|
.Dv UMTX_OP_SHM
|
||||||
request, there is no shared object associated with the provided key.
|
request, there is no shared memory object associated with the provided key.
|
||||||
.It Bq Er ENOMEM
|
.It Bq Er ENOMEM
|
||||||
The
|
The
|
||||||
.Dv UMTX_SHM_CREAT
|
.Dv UMTX_SHM_CREAT
|
||||||
sub-request of the
|
sub-request of the
|
||||||
.Dv UMTX_OP_SHM
|
.Dv UMTX_OP_SHM
|
||||||
request cannot be satisfied, because allocation of the shared object
|
request cannot be satisfied, because allocation of the shared memory object
|
||||||
would exceed the
|
would exceed the
|
||||||
.Dv RLIMIT_UMXP
|
.Dv RLIMIT_UMTXP
|
||||||
resource limit, see
|
resource limit, see
|
||||||
.Xr setrlimit 2 .
|
.Xr setrlimit 2 .
|
||||||
.It Bq Er EAGAIN
|
.It Bq Er EAGAIN
|
||||||
@ -1358,7 +1365,7 @@ specified in absolute time may be restartable.
|
|||||||
.It Bq Er ERESTART
|
.It Bq Er ERESTART
|
||||||
A signal was delivered during wait, for a restartable operation.
|
A signal was delivered during wait, for a restartable operation.
|
||||||
Mutex lock requests without timeout specified are restartable.
|
Mutex lock requests without timeout specified are restartable.
|
||||||
The error is typically not returned to userspace code, restart
|
The error is not returned to userspace code since restart
|
||||||
is handled by usual adjustment of the instruction counter.
|
is handled by usual adjustment of the instruction counter.
|
||||||
.El
|
.El
|
||||||
.Sh BUGS
|
.Sh BUGS
|
||||||
@ -1374,7 +1381,7 @@ implementation is only vulnerable to this race when operating on
|
|||||||
a shared mutex.
|
a shared mutex.
|
||||||
A possible fix for the current implementation is to strengthen the checks
|
A possible fix for the current implementation is to strengthen the checks
|
||||||
for shared mutexes before terminating them, in particular, verifying
|
for shared mutexes before terminating them, in particular, verifying
|
||||||
that the mutex memory is mapped from the POSIX shared object, allocated
|
that the mutex memory is mapped from a shared memory object allocated
|
||||||
by the
|
by the
|
||||||
.Dv UMTX_OP_SHM
|
.Dv UMTX_OP_SHM
|
||||||
request.
|
request.
|
||||||
@ -1402,5 +1409,5 @@ system call is non-standard and is used by the
|
|||||||
.Lb libthr
|
.Lb libthr
|
||||||
to implement
|
to implement
|
||||||
.St -p1003.1-2001
|
.St -p1003.1-2001
|
||||||
.Xr pthread(3)
|
.Xr pthread 3
|
||||||
functionality.
|
functionality.
|
||||||
|
@ -47,18 +47,20 @@ system call terminates the current kernel-scheduled thread.
|
|||||||
.Pp
|
.Pp
|
||||||
If the
|
If the
|
||||||
.Fa state
|
.Fa state
|
||||||
argument is not NULL, the location pointed to by the argument is
|
argument is not
|
||||||
updated with an arbitrary non-zero value, and
|
.Dv NULL ,
|
||||||
|
the location pointed to by the argument is
|
||||||
|
updated with an arbitrary non-zero value, and an
|
||||||
.Xr _umtx_op 2
|
.Xr _umtx_op 2
|
||||||
.Dv UMTX_OP_WAKE
|
.Dv UMTX_OP_WAKE
|
||||||
operation is consequently performed on the location.
|
operation is consequently performed on the location.
|
||||||
.Pp
|
.Pp
|
||||||
Attempts to terminate last thread in the process are silently ignored.
|
Attempts to terminate the last thread in the process are silently ignored.
|
||||||
Use
|
Use
|
||||||
.Xr _exit 2
|
.Xr _exit 2
|
||||||
syscall to terminate the process.
|
syscall to terminate the process.
|
||||||
.Sh RETURN VALUES
|
.Sh RETURN VALUES
|
||||||
The function does not return any values.
|
The function does not return a value.
|
||||||
A return from the function indicates that the calling thread was the
|
A return from the function indicates that the calling thread was the
|
||||||
last one in the process.
|
last one in the process.
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
@ -72,9 +74,9 @@ last one in the process.
|
|||||||
.Sh STANDARDS
|
.Sh STANDARDS
|
||||||
The
|
The
|
||||||
.Fn thr_exit
|
.Fn thr_exit
|
||||||
system call is non-standard and is used by the
|
system call is non-standard and is used by
|
||||||
.Lb libthr
|
.Lb libthr
|
||||||
to implement
|
to implement
|
||||||
.St -p1003.1-2001
|
.St -p1003.1-2001
|
||||||
.Xr pthread(3)
|
.Xr pthread 3
|
||||||
functionality.
|
functionality.
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm thr_kill
|
.Nm thr_kill
|
||||||
.Nd send signal to the thread
|
.Nd send signal to thread
|
||||||
.Sh LIBRARY
|
.Sh LIBRARY
|
||||||
.Lb libc
|
.Lb libc
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
@ -72,7 +72,7 @@ The
|
|||||||
.Fa sig
|
.Fa sig
|
||||||
argument defines the delivered signal.
|
argument defines the delivered signal.
|
||||||
It must be a valid signal number or zero.
|
It must be a valid signal number or zero.
|
||||||
In the later case no signal is actually send, and the call is used to
|
In the latter case no signal is actually sent, and the call is used to
|
||||||
verify the liveness of the thread.
|
verify the liveness of the thread.
|
||||||
.Pp
|
.Pp
|
||||||
The signal is delivered with
|
The signal is delivered with
|
||||||
@ -127,5 +127,5 @@ system calls are non-standard and are used by the
|
|||||||
.Lb libthr
|
.Lb libthr
|
||||||
to implement
|
to implement
|
||||||
.St -p1003.1-2001
|
.St -p1003.1-2001
|
||||||
.Xr pthread(3)
|
.Xr pthread 3
|
||||||
functionality.
|
functionality.
|
||||||
|
@ -52,7 +52,7 @@ The machine context for the new thread is copied from the creating thread's
|
|||||||
context, including coprocessor state.
|
context, including coprocessor state.
|
||||||
FPU state and specific machine registers are excluded from the copy.
|
FPU state and specific machine registers are excluded from the copy.
|
||||||
These are set according to ABI requirements and syscall parameters.
|
These are set according to ABI requirements and syscall parameters.
|
||||||
The FPU state for new thread is reinitialized to clean.
|
The FPU state for the new thread is reinitialized to clean.
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
.Fa param
|
.Fa param
|
||||||
@ -77,22 +77,22 @@ struct thr_param {
|
|||||||
and contains the following fields:
|
and contains the following fields:
|
||||||
.Bl -tag -width ".Va parent_tid"
|
.Bl -tag -width ".Va parent_tid"
|
||||||
.It Va start_func
|
.It Va start_func
|
||||||
The pointer to the thread entry function.
|
Pointer to the thread entry function.
|
||||||
Kernel arranges for the new thread to start executing the function
|
The kernel arranges for the new thread to start executing the function
|
||||||
upon the first return to userspace.
|
upon the first return to userspace.
|
||||||
.It Va arg
|
.It Va arg
|
||||||
Opaque argument supplied to the entry function.
|
Opaque argument supplied to the entry function.
|
||||||
.It Va stack_base
|
.It Va stack_base
|
||||||
Stack base address.
|
Stack base address.
|
||||||
The stack must be allocated by the caller.
|
The stack must be allocated by the caller.
|
||||||
On some architectures, the ABI might require that system put information
|
On some architectures, the ABI might require that the system put information
|
||||||
on the stack to ensure the execution environment for
|
on the stack to ensure the execution environment for
|
||||||
.Va start_func .
|
.Va start_func .
|
||||||
.It Va stack_size
|
.It Va stack_size
|
||||||
Stack size.
|
Stack size.
|
||||||
.It Va tls_base
|
.It Va tls_base
|
||||||
TLS base address.
|
TLS base address.
|
||||||
The value of TLS base is loaded to the ABI-defined machine register
|
The value of TLS base is loaded into the ABI-defined machine register
|
||||||
in the new thread context.
|
in the new thread context.
|
||||||
.It Va tls_size
|
.It Va tls_size
|
||||||
TLS size.
|
TLS size.
|
||||||
@ -113,9 +113,9 @@ issuing the
|
|||||||
syscall, while
|
syscall, while
|
||||||
.Va parent_tid
|
.Va parent_tid
|
||||||
is used by the thread creator.
|
is used by the thread creator.
|
||||||
The later is separate from the
|
The latter is separate from
|
||||||
.Va child_tid
|
.Va child_tid
|
||||||
because new thread might exit and free its thread data before parent
|
because the new thread might exit and free its thread data before the parent
|
||||||
has a chance to execute far enough to access it.
|
has a chance to execute far enough to access it.
|
||||||
.It Va flags
|
.It Va flags
|
||||||
Thread creation flags.
|
Thread creation flags.
|
||||||
@ -132,7 +132,9 @@ The flag is not currently implemented.
|
|||||||
.El
|
.El
|
||||||
.It Va rtp
|
.It Va rtp
|
||||||
Real-time scheduling priority for the new thread.
|
Real-time scheduling priority for the new thread.
|
||||||
May be NULL if thread should inherit the priority from the
|
May be
|
||||||
|
.Dv NULL
|
||||||
|
to inherit the priority from the
|
||||||
creating thread.
|
creating thread.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
@ -184,14 +186,16 @@ initial data on the stack.
|
|||||||
.It Bq Er EINVAL
|
.It Bq Er EINVAL
|
||||||
The
|
The
|
||||||
.Fa param_size
|
.Fa param_size
|
||||||
argument specifies negative value, or its value is greater than the
|
argument specifies a negative value, or the value is greater than the
|
||||||
largest
|
largest
|
||||||
.Fa struct param
|
.Fa struct param
|
||||||
size the kernel can interpret.
|
size the kernel can interpret.
|
||||||
.It Bq Er EINVAL
|
.It Bq Er EINVAL
|
||||||
The
|
The
|
||||||
.Fa rtp
|
.Fa rtp
|
||||||
member is not NULL, but specifies invalid scheduling parameters.
|
member is not
|
||||||
|
.Dv NULL
|
||||||
|
and specifies invalid scheduling parameters.
|
||||||
.It Bq Er EINVAL
|
.It Bq Er EINVAL
|
||||||
The specified TLS base is invalid.
|
The specified TLS base is invalid.
|
||||||
.It Bq Er EPROCLIM
|
.It Bq Er EPROCLIM
|
||||||
@ -224,5 +228,5 @@ system call is non-standard and is used by the
|
|||||||
.Lb libthr
|
.Lb libthr
|
||||||
to implement
|
to implement
|
||||||
.St -p1003.1-2001
|
.St -p1003.1-2001
|
||||||
.Xr pthread(3)
|
.Xr pthread 3
|
||||||
functionality.
|
functionality.
|
||||||
|
@ -80,9 +80,9 @@ argument is not valid.
|
|||||||
.Sh STANDARDS
|
.Sh STANDARDS
|
||||||
The
|
The
|
||||||
.Fn thr_self
|
.Fn thr_self
|
||||||
system call is non-standard and is used by the
|
system call is non-standard and is used by
|
||||||
.Lb libthr
|
.Lb libthr
|
||||||
to implement
|
to implement
|
||||||
.St -p1003.1-2001
|
.St -p1003.1-2001
|
||||||
.Xr pthread(3)
|
.Xr pthread 3
|
||||||
functionality.
|
functionality.
|
||||||
|
@ -45,7 +45,7 @@ The
|
|||||||
.Fn thr_set_name
|
.Fn thr_set_name
|
||||||
sets the user-visible name for the kernel thread with the identifier
|
sets the user-visible name for the kernel thread with the identifier
|
||||||
.Va id
|
.Va id
|
||||||
in the current process, to the NULL-terminated string
|
in the current process, to the NUL-terminated string
|
||||||
.Va name .
|
.Va name .
|
||||||
The thread name can be seen in the output of the
|
The thread name can be seen in the output of the
|
||||||
.Xr ps 1
|
.Xr ps 1
|
||||||
@ -92,5 +92,5 @@ does not exist in the current process.
|
|||||||
.Sh STANDARDS
|
.Sh STANDARDS
|
||||||
The
|
The
|
||||||
.Fn thr_new
|
.Fn thr_new
|
||||||
system call is non-standard and is used by the
|
system call is non-standard and is used by
|
||||||
.Lb libthr .
|
.Lb libthr .
|
||||||
|
Loading…
x
Reference in New Issue
Block a user