Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread Use



details:   https://anonhg.NetBSD.org/src/rev/89dfca136e34
branches:  trunk
changeset: 782656:89dfca136e34
user:      uwe <uwe%NetBSD.org@localhost>
date:      Mon Nov 12 23:11:05 2012 +0000

description:
Use

  .Vt type var No = Dv INITIALIZER;

to provide examples of static initialization in SYNOPSIS section.
.Va macro does the wrong thing (check groff PostScript output) and the
need for .Pp kludge (now dropped) should have been an indication too.

While here move static initialization example to be right after the
declaration of *_init().

diffstat:

 lib/libpthread/pthread_cond.3   |  5 ++---
 lib/libpthread/pthread_mutex.3  |  5 ++---
 lib/libpthread/pthread_once.3   |  5 ++---
 lib/libpthread/pthread_rwlock.3 |  5 ++---
 4 files changed, 8 insertions(+), 12 deletions(-)

diffs (90 lines):

diff -r ac0d709f4d61 -r 89dfca136e34 lib/libpthread/pthread_cond.3
--- a/lib/libpthread/pthread_cond.3     Mon Nov 12 22:51:42 2012 +0000
+++ b/lib/libpthread/pthread_cond.3     Mon Nov 12 23:11:05 2012 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pthread_cond.3,v 1.5 2010/07/09 20:56:01 wiz Exp $
+.\" $NetBSD: pthread_cond.3,v 1.6 2012/11/12 23:11:05 uwe Exp $
 .\"
 .\" Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -66,6 +66,7 @@
 .Ft int
 .Fn pthread_cond_init "pthread_cond_t * restrict cond" \
 "const pthread_condattr_t * restrict attr"
+.Vt pthread_cond_t cond No = Dv PTHREAD_COND_INITIALIZER;
 .Ft int
 .Fn pthread_cond_destroy "pthread_cond_t *cond"
 .Ft int
@@ -78,8 +79,6 @@
 .Ft int
 .Fn pthread_cond_timedwait "pthread_cond_t * restrict cond" \
 "pthread_mutex_t * restrict mutex" "const struct timespec * restrict abstime"
-.Pp
-.Va pthread_cond_t cond = Dv PTHREAD_COND_INITIALIZER;
 .\" ----------------------------------------------------------------------------
 .Sh DESCRIPTION
 Condition variables are intended to be used to communicate changes in
diff -r ac0d709f4d61 -r 89dfca136e34 lib/libpthread/pthread_mutex.3
--- a/lib/libpthread/pthread_mutex.3    Mon Nov 12 22:51:42 2012 +0000
+++ b/lib/libpthread/pthread_mutex.3    Mon Nov 12 23:11:05 2012 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pthread_mutex.3,v 1.5 2010/07/09 10:55:11 wiz Exp $
+.\" $NetBSD: pthread_mutex.3,v 1.6 2012/11/12 23:11:05 uwe Exp $
 .\"
 .\" Copyright (c) 2002, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -66,6 +66,7 @@
 .Ft int
 .Fn pthread_mutex_init "pthread_mutex_t * restrict mutex" \
 "const pthread_mutexattr_t * restrict attr"
+.Vt pthread_mutex_t mutex No = Dv PTHREAD_MUTEX_INITIALIZER;
 .Ft int
 .Fn pthread_mutex_destroy "pthread_mutex_t *mutex"
 .Ft int
@@ -74,8 +75,6 @@
 .Fn pthread_mutex_trylock "pthread_mutex_t *mutex"
 .Ft int
 .Fn pthread_mutex_unlock "pthread_mutex_t *mutex"
-.Pp
-.Va pthread_mutex_t mutex = Dv PTHREAD_MUTEX_INITIALIZER;
 .\" ----------------------------------------------------------------------------
 .Sh DESCRIPTION
 The
diff -r ac0d709f4d61 -r 89dfca136e34 lib/libpthread/pthread_once.3
--- a/lib/libpthread/pthread_once.3     Mon Nov 12 22:51:42 2012 +0000
+++ b/lib/libpthread/pthread_once.3     Mon Nov 12 23:11:05 2012 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pthread_once.3,v 1.7 2010/07/09 08:51:28 jruoho Exp $
+.\" $NetBSD: pthread_once.3,v 1.8 2012/11/12 23:11:05 uwe Exp $
 .\"
 .\" Copyright (c) 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -67,8 +67,7 @@
 .In pthread.h
 .Ft int
 .Fn pthread_once "pthread_once_t *once_control" "void (*init_routine)(void)"
-.Pp
-.Va pthread_once_t once_control = Dv PTHREAD_ONCE_INIT;
+.Vt pthread_once_t once_control No = Dv PTHREAD_ONCE_INIT;
 .Sh DESCRIPTION
 The first call to
 .Fn pthread_once
diff -r ac0d709f4d61 -r 89dfca136e34 lib/libpthread/pthread_rwlock.3
--- a/lib/libpthread/pthread_rwlock.3   Mon Nov 12 22:51:42 2012 +0000
+++ b/lib/libpthread/pthread_rwlock.3   Mon Nov 12 23:11:05 2012 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pthread_rwlock.3,v 1.3 2010/07/09 10:55:11 wiz Exp $
+.\" $NetBSD: pthread_rwlock.3,v 1.4 2012/11/12 23:11:05 uwe Exp $
 .\"
 .\" Copyright (c) 2002, 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -63,8 +63,7 @@
 .Ft int
 .Fn pthread_rwlock_init "pthread_rwlock_t * restrict lock" \
 "const pthread_rwlockattr_t * restrict attr"
-.Pp
-.Va pthread_rwlock_t lock = Dv PTHREAD_RWLOCK_INITIALIZER;
+.Vt pthread_rwlock_t lock No = Dv PTHREAD_RWLOCK_INITIALIZER;
 .Ft int
 .Fn pthread_rwlock_destroy "pthread_rwlock_t *lock"
 .Ft int



Home | Main Index | Thread Index | Old Index