Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libpthread Fix some typos, improve wording.
details: https://anonhg.NetBSD.org/src/rev/1a96cfc3c3bd
branches: trunk
changeset: 456216:1a96cfc3c3bd
user: wiz <wiz%NetBSD.org@localhost>
date: Sat Apr 27 10:57:11 2019 +0000
description:
Fix some typos, improve wording.
diffstat:
lib/libpthread/call_once.3 | 4 ++--
lib/libpthread/cnd.3 | 18 ++++++++++--------
lib/libpthread/mtx.3 | 40 +++++++++++++++++++++-------------------
lib/libpthread/thrd.3 | 45 ++++++++++++++++++++-------------------------
lib/libpthread/threads.3 | 12 ++++++------
lib/libpthread/tss.3 | 39 +++++++++++++++++----------------------
6 files changed, 76 insertions(+), 82 deletions(-)
diffs (truncated from 467 to 300 lines):
diff -r ab6c4c5ff325 -r 1a96cfc3c3bd lib/libpthread/call_once.3
--- a/lib/libpthread/call_once.3 Sat Apr 27 10:40:17 2019 +0000
+++ b/lib/libpthread/call_once.3 Sat Apr 27 10:57:11 2019 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: call_once.3,v 1.1 2019/04/24 11:43:19 kamil Exp $
+.\" $NetBSD: call_once.3,v 1.2 2019/04/27 10:57:11 wiz Exp $
.\"
.\" Copyright (c) 2016 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -38,7 +38,7 @@
.Sh SYNOPSIS
.In threads.h
.Ft void
-.Fn call_once "once_flag *flag" "void (*func)(void))"
+.Fn call_once "once_flag *flag" "void (*func)(void)"
.Vt #define ONCE_FLAG_INIT /* implementation specified */
.Sh DESCRIPTION
The
diff -r ab6c4c5ff325 -r 1a96cfc3c3bd lib/libpthread/cnd.3
--- a/lib/libpthread/cnd.3 Sat Apr 27 10:40:17 2019 +0000
+++ b/lib/libpthread/cnd.3 Sat Apr 27 10:57:11 2019 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: cnd.3,v 1.1 2019/04/24 11:43:19 kamil Exp $
+.\" $NetBSD: cnd.3,v 1.2 2019/04/27 10:57:11 wiz Exp $
.\"
.\" Copyright (c) 2016 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -72,7 +72,7 @@
.Pp
The
.Fn cnd_init
-function initializes new
+function initializes a new
.Fa cond
variable.
.Pp
@@ -81,13 +81,13 @@
function unblock one thread that currently waits on the
.Fa cond
variable.
-If there are no threads blocked
+If there are no threads blocked,
.Fn cnd_signal
does nothing and returns success.
.Pp
The
.Fn cnd_timedwait
-function atomicalyl unlocks the mutex
+function atomically unlocks the mutex
.Fa mtx
and blocks on the condition variable
.Fa cond
@@ -109,7 +109,7 @@
.Fn cnd_wait
function atomically unlocks the mutex
.Fa mtx
-and tries to blocks on on the conditional variable
+and tries to block on the conditional variable
.Fa cond
until a thread is signalled by a call to
.Fn cnd_signal
@@ -121,7 +121,7 @@
If the mutex is not locked by the calling thread then behavior is undefined.
.Sh RETURN VALUES
The
-.Fn cnd_broadcast ,
+.Fn cnd_broadcast
function returns
.Dv thrd_success
on success or
@@ -131,6 +131,8 @@
The
.Fn cnd_destroy
function returns no value.
+.Pp
+The
.Fn cnd_init
function returns
.Dv thrd_success
@@ -153,7 +155,7 @@
on success, otherwise
.Dv thrd_timedout
to indicate that system time has reached or exceeded the time specified in
-.Dv ts
+.Dv ts ,
or
.Dv thrd_error
on failure.
@@ -162,7 +164,7 @@
.Fn cnd_wait
function returns
.Dv thrd_success
-on success, otherwise
+on success or
.Dv thrd_error
on failure.
.Sh SEE ALSO
diff -r ab6c4c5ff325 -r 1a96cfc3c3bd lib/libpthread/mtx.3
--- a/lib/libpthread/mtx.3 Sat Apr 27 10:40:17 2019 +0000
+++ b/lib/libpthread/mtx.3 Sat Apr 27 10:57:11 2019 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: mtx.3,v 1.1 2019/04/24 11:43:19 kamil Exp $
+.\" $NetBSD: mtx.3,v 1.2 2019/04/27 10:57:11 wiz Exp $
.\"
.\" Copyright (c) 2016 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -72,13 +72,13 @@
are as follows:
.Bl -column "mtx_plain | mtx_recursive"
.It Sy "Type" Ta Sy "Description"
-.It Xr mtx_plain Ta basic mutex
-.It Xr mtx_timed Ta mutex with timeout support
-.It Xr mtx_plain | mtx_recursive Ta basic recursive mutex
-.It Xr mtx_timed | mtx_recursive Ta recursive mutex with timeout support
+.It Dv mtx_plain Ta basic mutex
+.It Dv mtx_timed Ta mutex with timeout support
+.It Dv mtx_plain | Dv mtx_recursive Ta basic recursive mutex
+.It Dv mtx_timed | Dv mtx_recursive Ta recursive mutex with timeout support
.El
.Pp
-The underlaying
+The underlying
.Nx
implementation of mutex types does not distinguish between
.Dv mtx_plain
@@ -91,17 +91,17 @@
function locks the
.Fa mtx
object.
-It is required the never lock multiple times the same
+It is required to never lock the same
.Fa mtx
object without the
.Dv mtx_recursive
-property.
+property multiple times.
If the
.Fa mtx
object is already locked by another thread,
-caller of
+the caller of
.Fa mtx_lock
-blocks until lock becomes available.
+blocks until the lock becomes available.
.Pp
The
.Fn mtx_timedlock
@@ -109,7 +109,7 @@
.Fa mtx
object.
In case of blocked resource by another thread,
-this call blocks with specified timeout in the
+this call blocks for the specified timeout in the
.Fa ts
argument.
The timeout argument is
@@ -117,16 +117,16 @@
based time of
.Dv timespec
type.
-It is required the never lock multiple times the same
+It is required to never lock the same
.Fa mtx
object without the
.Dv mtx_recursive
-property.
-In portable code there must be used
+property multiple times.
+In portable code, a
.Fa mtx
object with the
.Dv mtx_recursive
-property.
+property must be used in such a case.
.Pp
The
.Fn mtx_trylock
@@ -142,7 +142,9 @@
function unlocks the
.Fa mtx
object.
-This call must be proceded with lock by the calling thread.
+This call must be preceded with a matching
+.Fn mtx_lock
+call in the same thread.
.Sh RETURN VALUES
The
.Fn mtx_destroy
@@ -172,7 +174,7 @@
otherwise
.Dv thrd_timedout
to indicate that system time has reached or exceeded the time specified in
-.Dv ts
+.Dv ts ,
or
.Dv thrd_error
on failure.
@@ -186,7 +188,7 @@
.Dv thrd_timedout
to indicate that
.Fa mtx
-object is already locked or
+object is already locked, or
.Dv thrd_error
on failure.
.Pp
@@ -199,7 +201,7 @@
.Dv thrd_timedout
to indicate that
.Fa mtx
-object is already locked or
+object is already locked, or
.Dv thrd_error
on failure.
.Sh SEE ALSO
diff -r ab6c4c5ff325 -r 1a96cfc3c3bd lib/libpthread/thrd.3
--- a/lib/libpthread/thrd.3 Sat Apr 27 10:40:17 2019 +0000
+++ b/lib/libpthread/thrd.3 Sat Apr 27 10:57:11 2019 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: thrd.3,v 1.2 2019/04/24 18:47:54 kamil Exp $
+.\" $NetBSD: thrd.3,v 1.3 2019/04/27 10:57:11 wiz Exp $
.\"
.\" Copyright (c) 2016 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -57,7 +57,7 @@
.Sh DESCRIPTION
The
.Nm
-interface operates over opaque object of the
+interface operates over opaque objects of the
.Dv thrd_t
type.
.Pp
@@ -65,12 +65,12 @@
.Fn thrd_create
function is used to create a new thread, calling
.Fa func
-with
+with the
.Fa arg
parameter.
This function initializes the
.Fa thr
-object with the identifier of newly created thread.
+object with the identifier of the newly created thread.
The completion of
.Fn thrd_create
is synchronized with the start of the newly produced thread.
@@ -81,13 +81,13 @@
.Pp
The
.Fn thrd_current
-function returns thread identifier.
+function returns the thread identifier of the current thread.
.Pp
The
.Fn thrd_detach
function is used to indicate that storage for the
.Fa thr
-object can be reclaimed on thread's termination.
+object can be reclaimed on the thread's termination.
The
.Fa thr
object cannot be already detached or joined.
@@ -102,13 +102,13 @@
.Pp
The
.Fn thrd_exit
-function terminates calling thread and passes the
+function terminates the calling thread and passes the
.Fa res
-value, that might be read by the
+value that might be read by the
.Fn thrd_join
function.
-The program terminates once all threads has been terminated with
-result equivalent to calling the
+The program terminates once all threads have been terminated with
+an exit code equivalent to calling the
.Xr exit 3
function with the
.Dv EXIT_SUCCESS
@@ -139,7 +139,7 @@
The
.Fa remaining
parameter stores requested timeout reduced with the time actually suspended.
-This argument is used when the
+This argument is used when
.Fn thrd_sleep
has been interrupted.
It is valid code to point both arguments
@@ -147,10 +147,10 @@
and
.Fa remaining
to the same object.
-It is not guaranteed that sleep will not take longer than specified
+It is not guaranteed that sleep will not take longer than specified in
.Fa duration ,
however unless interrupted with a signal it will not take shorter
-than specified interval.
Home |
Main Index |
Thread Index |
Old Index