Austin Group Bug Tracker
2014-10-09 16:20:53 UTC
A NOTE has been added to this issue.
======================================================================
http://austingroupbugs.net/view.php?id=874
======================================================================
Reported By: geoffclare
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 874
Category: System Interfaces
Type: Error
Severity: Comment
Priority: normal
Status: New
Name: Geoff Clare
Organization: The Open Group
User Reference:
Section: pthread_once()
Page Number: 1685
Line Number: 54518
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2014-09-05 10:31 UTC
Last Modified: 2014-10-09 16:20 UTC
======================================================================
Summary: pthread_once() rationale makes bogus claims
======================================================================
----------------------------------------------------------------------
(0002417) rhansen (manager) - 2014-10-09 16:20
http://austingroupbugs.net/view.php?id=874#c2417
----------------------------------------------------------------------
On page 1684 line 54506 section pthread_once()
and page 1685 line 54528 section pthread_once()
in the RATIONALE section, change from:
<blockquote><pre>extern int initialize_random();</pre></blockquote>
to:
<blockquote><pre>extern void initialize_random(void);</pre></blockquote>
On page 1685 line 54518 section pthread_once() in the RATIONALE section,
change from:
<blockquote>For dynamic library initialization in a multi-threaded process,
a simple initialization flag is not sufficient; the flag needs to be
protected against modification by multiple threads simultaneously calling
into the library. Protecting the flag requires the use of a mutex;
however, mutexes have to be initialized before they are used. Ensuring
that the mutex is only initialized once requires a recursive solution to
this problem.
The use of <i>pthread_once</i>() not only supplies an
implementation-guaranteed means of dynamic initialization, it provides an
aid to the reliable construction of multi-threaded and realtime systems.
The preceding example then becomes:</blockquote>
to:
<blockquote>For dynamic library initialization in a multi-threaded process,
if an initialization flag is used the flag needs to be protected against
modification by multiple threads simultaneously calling into the library.
This can be done by using a mutex (initialized by assigning
PTHREAD_MUTEX_INITIALIZER). However, the better solution is to use
<i>pthread_once</i>(), which is designed for exactly this purpose, as
follows:</blockquote>
Issue History
Date Modified Username Field Change
======================================================================
2014-09-05 10:31 geoffclare New Issue
2014-09-05 10:31 geoffclare Name => Geoff Clare
2014-09-05 10:31 geoffclare Organization => The Open Group
2014-09-05 10:31 geoffclare Section => pthread_once()
2014-09-05 10:31 geoffclare Page Number => 1685
2014-09-05 10:31 geoffclare Line Number => 54518
2014-09-05 10:31 geoffclare Interp Status => ---
2014-09-06 13:14 dalias Note Added: 0002375
2014-10-09 16:20 rhansen Note Added: 0002417
======================================================================
======================================================================
http://austingroupbugs.net/view.php?id=874
======================================================================
Reported By: geoffclare
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 874
Category: System Interfaces
Type: Error
Severity: Comment
Priority: normal
Status: New
Name: Geoff Clare
Organization: The Open Group
User Reference:
Section: pthread_once()
Page Number: 1685
Line Number: 54518
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2014-09-05 10:31 UTC
Last Modified: 2014-10-09 16:20 UTC
======================================================================
Summary: pthread_once() rationale makes bogus claims
======================================================================
----------------------------------------------------------------------
(0002417) rhansen (manager) - 2014-10-09 16:20
http://austingroupbugs.net/view.php?id=874#c2417
----------------------------------------------------------------------
On page 1684 line 54506 section pthread_once()
and page 1685 line 54528 section pthread_once()
in the RATIONALE section, change from:
<blockquote><pre>extern int initialize_random();</pre></blockquote>
to:
<blockquote><pre>extern void initialize_random(void);</pre></blockquote>
On page 1685 line 54518 section pthread_once() in the RATIONALE section,
change from:
<blockquote>For dynamic library initialization in a multi-threaded process,
a simple initialization flag is not sufficient; the flag needs to be
protected against modification by multiple threads simultaneously calling
into the library. Protecting the flag requires the use of a mutex;
however, mutexes have to be initialized before they are used. Ensuring
that the mutex is only initialized once requires a recursive solution to
this problem.
The use of <i>pthread_once</i>() not only supplies an
implementation-guaranteed means of dynamic initialization, it provides an
aid to the reliable construction of multi-threaded and realtime systems.
The preceding example then becomes:</blockquote>
to:
<blockquote>For dynamic library initialization in a multi-threaded process,
if an initialization flag is used the flag needs to be protected against
modification by multiple threads simultaneously calling into the library.
This can be done by using a mutex (initialized by assigning
PTHREAD_MUTEX_INITIALIZER). However, the better solution is to use
<i>pthread_once</i>(), which is designed for exactly this purpose, as
follows:</blockquote>
Issue History
Date Modified Username Field Change
======================================================================
2014-09-05 10:31 geoffclare New Issue
2014-09-05 10:31 geoffclare Name => Geoff Clare
2014-09-05 10:31 geoffclare Organization => The Open Group
2014-09-05 10:31 geoffclare Section => pthread_once()
2014-09-05 10:31 geoffclare Page Number => 1685
2014-09-05 10:31 geoffclare Line Number => 54518
2014-09-05 10:31 geoffclare Interp Status => ---
2014-09-06 13:14 dalias Note Added: 0002375
2014-10-09 16:20 rhansen Note Added: 0002417
======================================================================