Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8c1c2e3

Browse files
committed
thread-safety
Apply full patch to enable thread-safety by default, e.g. doc changes.
1 parentaebc4e6 commit8c1c2e3

File tree

6 files changed

+48
-137
lines changed

6 files changed

+48
-137
lines changed

‎configure

Lines changed: 16 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,6 @@ with_CC
823823
enable_depend
824824
enable_cassert
825825
enable_thread_safety
826-
enable_thread_safety_force
827826
with_tcl
828827
with_tclconfig
829828
with_perl
@@ -1497,9 +1496,7 @@ Optional Features:
14971496
--enable-dtrace build with DTrace support
14981497
--enable-depend turn on automatic dependency tracking
14991498
--enable-cassert enable assertion checks (for debugging)
1500-
--disable-thread-safety make client libraries thread-safe
1501-
--enable-thread-safety-force
1502-
force thread-safety despite thread test failure
1499+
--disable-thread-safety disable thread-safety in client libraries
15031500
--disable-float4-byval disable float4 passed by value
15041501
--disable-float8-byval disable float8 passed by value
15051502
--disable-largefile omit support for large files
@@ -4884,41 +4881,6 @@ else
48844881
fi
48854882

48864883

4887-
4888-
4889-
4890-
# Check whether --enable-thread-safety-force was given.
4891-
if test "${enable_thread_safety_force+set}" = set; then
4892-
enableval=$enable_thread_safety_force;
4893-
case $enableval in
4894-
yes)
4895-
:
4896-
;;
4897-
no)
4898-
:
4899-
;;
4900-
*)
4901-
{ { $as_echo "$as_me:$LINENO: error: no argument expected for --enable-thread-safety-force option" >&5
4902-
$as_echo "$as_me: error: no argument expected for --enable-thread-safety-force option" >&2;}
4903-
{ (exit 1); exit 1; }; }
4904-
;;
4905-
esac
4906-
4907-
else
4908-
enable_thread_safety_force=no
4909-
4910-
fi
4911-
4912-
4913-
if test "$enable_thread_safety" = yes -o \
4914-
"$enable_thread_safety_force" = yes; then
4915-
enable_thread_safety="yes"# for 'force'
4916-
4917-
cat >>confdefs.h <<\_ACEOF
4918-
#define ENABLE_THREAD_SAFETY 1
4919-
_ACEOF
4920-
4921-
fi
49224884
{ $as_echo "$as_me:$LINENO: result: $enable_thread_safety" >&5
49234885
$as_echo "$enable_thread_safety" >&6; }
49244886

@@ -21287,10 +21249,10 @@ PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEM
2128721249
if test "$PTHREAD_CC" != "$CC"; then
2128821250
{ { $as_echo "$as_me:$LINENO: error:
2128921251
PostgreSQL does not support platforms that require a special compiler
21290-
for thread safety." >&5
21252+
for thread safety; use --disable-thread-safety to disable thread safety." >&5
2129121253
$as_echo "$as_me: error:
2129221254
PostgreSQL does not support platforms that require a special compiler
21293-
for thread safety." >&2;}
21255+
for thread safety; use --disable-thread-safety to disable thread safety." >&2;}
2129421256
{ (exit 1); exit 1; }; }
2129521257
fi
2129621258

@@ -21436,8 +21398,10 @@ fi
2143621398
if test "x$ac_cv_header_pthread_h" = x""yes; then
2143721399
:
2143821400
else
21439-
{ { $as_echo "$as_me:$LINENO: error: pthread.h not found, required for --enable-thread-safety" >&5
21440-
$as_echo "$as_me: error: pthread.h not found, required for --enable-thread-safety" >&2;}
21401+
{ { $as_echo "$as_me:$LINENO: error:
21402+
pthread.h not found; use --disable-thread-safety to disable thread safety" >&5
21403+
$as_echo "$as_me: error:
21404+
pthread.h not found; use --disable-thread-safety to disable thread safety" >&2;}
2144121405
{ (exit 1); exit 1; }; }
2144221406
fi
2144321407

@@ -26349,10 +26313,10 @@ HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals
2634926313
if test "$pgac_cv_func_posix_signals" != yes -a "$enable_thread_safety" = yes; then
2635026314
{ { $as_echo "$as_me:$LINENO: error:
2635126315
Thread-safety requires POSIX signals, which are not supported by this
26352-
operating system." >&5
26316+
operating system; use --disable-thread-safety to disable thread safety." >&5
2635326317
$as_echo "$as_me: error:
2635426318
Thread-safety requires POSIX signals, which are not supported by this
26355-
operating system." >&2;}
26319+
operating system; use --disable-thread-safety to disable thread safety." >&2;}
2635626320
{ (exit 1); exit 1; }; }
2635726321
fi
2635826322
fi
@@ -28202,24 +28166,7 @@ done
2820228166
# We have to run the thread test near the end so we have all our symbols
2820328167
# defined. Cross compiling throws a warning.
2820428168
#
28205-
if test "$enable_thread_safety_force" = yes; then
28206-
if test "$PORTNAME" != "win32"
28207-
then
28208-
{ $as_echo "$as_me:$LINENO: WARNING:
28209-
*** Skipping thread test program. --enable-thread-safety-force was used.
28210-
*** Run the program in src/test/thread on the your machine and add proper
28211-
*** locking function calls to your applications to guarantee thread safety.
28212-
" >&5
28213-
$as_echo "$as_me: WARNING:
28214-
*** Skipping thread test program. --enable-thread-safety-force was used.
28215-
*** Run the program in src/test/thread on the your machine and add proper
28216-
*** locking function calls to your applications to guarantee thread safety.
28217-
" >&2;}
28218-
else
28219-
{ $as_echo "$as_me:$LINENO: WARNING: *** skipping thread test on Win32" >&5
28220-
$as_echo "$as_me: WARNING: *** skipping thread test on Win32" >&2;}
28221-
fi
28222-
elif test "$enable_thread_safety" = yes; then
28169+
if test "$enable_thread_safety" = yes; then
2822328170
if test "$PORTNAME" != "win32"
2822428171
then
2822528172
{ $as_echo "$as_me:$LINENO: checking thread safety of required library functions" >&5
@@ -28282,21 +28229,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
2828228229
{ $as_echo "$as_me:$LINENO: result: no" >&5
2828328230
$as_echo "no" >&6; }
2828428231
{ { $as_echo "$as_me:$LINENO: error: thread test program failed
28285-
This platform is not thread-safe. Check the file 'config.log' for the
28286-
exact reason.
28287-
28288-
You can use the configure option --enable-thread-safety-force to force
28289-
threads to be enabled. But you must then run the program in
28290-
src/test/thread and add locking function calls to your applications to
28291-
guarantee thread safety." >&5
28232+
This platform is not thread-safe. Check the file 'config.log' or compile
28233+
and run src/test/thread/thread_test for the exact reason.
28234+
Use --disable-thread-safety to disable thread safety." >&5
2829228235
$as_echo "$as_me: error: thread test program failed
28293-
This platform is not thread-safe. Check the file 'config.log' for the
28294-
exact reason.
28295-
28296-
You can use the configure option --enable-thread-safety-force to force
28297-
threads to be enabled. But you must then run the program in
28298-
src/test/thread and add locking function calls to your applications to
28299-
guarantee thread safety." >&2;}
28236+
This platform is not thread-safe. Check the file 'config.log' or compile
28237+
and run src/test/thread/thread_test for the exact reason.
28238+
Use --disable-thread-safety to disable thread safety." >&2;}
2830028239
{ (exit 1); exit 1; }; }
2830128240
fi
2830228241
rm -rf conftest.dSYM

‎configure.in

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.614 2009/12/01 23:02:44 momjian Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.615 2009/12/02 14:07:25 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -558,15 +558,7 @@ IFS=$ac_save_IFS
558558
# Enable thread-safe client libraries
559559
#
560560
AC_MSG_CHECKING([allow thread-safe client libraries])
561-
PGAC_ARG_BOOL(enable, thread-safety, yes, [make client libraries thread-safe])
562-
563-
PGAC_ARG_BOOL(enable, thread-safety-force, no, [force thread-safety despite thread test failure])
564-
if test "$enable_thread_safety" = yes -o \
565-
"$enable_thread_safety_force" = yes; then
566-
enable_thread_safety="yes"# for 'force'
567-
AC_DEFINE([ENABLE_THREAD_SAFETY], 1,
568-
[Define to 1 to build client libraries as thread-safe code. (--enable-thread-safety)])
569-
fi
561+
PGAC_ARG_BOOL(enable, thread-safety, yes, [disable thread-safety in client libraries])
570562
AC_MSG_RESULT([$enable_thread_safety])
571563
AC_SUBST(enable_thread_safety)
572564

@@ -1399,7 +1391,7 @@ PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEM
13991391
if test "$PTHREAD_CC" != "$CC"; then
14001392
AC_MSG_ERROR([
14011393
PostgreSQL does not support platforms that require a special compiler
1402-
for thread safety.])
1394+
for thread safety; use --disable-thread-safety to disable thread safety.])
14031395
fi
14041396

14051397
# Check for *_r functions
@@ -1409,7 +1401,8 @@ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
14091401
LIBS="$LIBS $PTHREAD_LIBS"
14101402

14111403
if test "$PORTNAME" != "win32"; then
1412-
AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([pthread.h not found, required for --enable-thread-safety])])
1404+
AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([
1405+
pthread.h not found; use --disable-thread-safety to disable thread safety])])
14131406
fi
14141407

14151408
AC_CHECK_FUNCS([strerror_r getpwuid_r gethostbyname_r])
@@ -1655,7 +1648,7 @@ PGAC_FUNC_POSIX_SIGNALS
16551648
if test "$pgac_cv_func_posix_signals" != yes -a "$enable_thread_safety" = yes; then
16561649
AC_MSG_ERROR([
16571650
Thread-safety requires POSIX signals, which are not supported by this
1658-
operating system.])
1651+
operating system; use --disable-thread-safety to disable thread safety.])
16591652
fi
16601653
fi
16611654

@@ -1744,18 +1737,7 @@ AC_CHECK_PROGS(OSX, [osx sgml2xml sx])
17441737
# We have to run the thread test near the end so we have all our symbols
17451738
# defined. Cross compiling throws a warning.
17461739
#
1747-
if test "$enable_thread_safety_force" = yes; then
1748-
if test "$PORTNAME" != "win32"
1749-
then
1750-
AC_MSG_WARN([
1751-
*** Skipping thread test program. --enable-thread-safety-force was used.
1752-
*** Run the program in src/test/thread on the your machine and add proper
1753-
*** locking function calls to your applications to guarantee thread safety.
1754-
])
1755-
else
1756-
AC_MSG_WARN([*** skipping thread test on Win32])
1757-
fi
1758-
elif test "$enable_thread_safety" = yes; then
1740+
if test "$enable_thread_safety" = yes; then
17591741
if test "$PORTNAME" != "win32"
17601742
then
17611743
AC_MSG_CHECKING([thread safety of required library functions])
@@ -1768,13 +1750,9 @@ AC_TRY_RUN([#include "$srcdir/src/test/thread/thread_test.c"],
17681750
[AC_MSG_RESULT(yes)],
17691751
[AC_MSG_RESULT(no)
17701752
AC_MSG_ERROR([thread test program failed
1771-
This platform is not thread-safe. Check the file 'config.log' for the
1772-
exact reason.
1773-
1774-
You can use the configure option --enable-thread-safety-force to force
1775-
threads to be enabled. But you must then run the program in
1776-
src/test/thread and add locking function calls to your applications to
1777-
guarantee thread safety.])],
1753+
This platform is not thread-safe. Check the file 'config.log' or compile
1754+
and run src/test/thread/thread_test for the exact reason.
1755+
Use --disable-thread-safety to disable thread safety.])],
17781756
[AC_MSG_RESULT(maybe)
17791757
AC_MSG_WARN([
17801758
*** Skipping thread test program because of cross-compile build.

‎doc/src/sgml/ecpg.sgml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.92 2009/11/30 14:47:37 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.93 2009/12/02 14:07:25 momjian Exp $ -->
22

33
<chapter id="ecpg">
44
<title><application>ECPG</application> - Embedded <acronym>SQL</acronym> in C</title>
@@ -4709,10 +4709,9 @@ ECPG = ecpg
47094709
</para>
47104710

47114711
<para>
4712-
The <application>ecpg</application> library is thread-safe if it is built
4713-
using the <option>--enable-thread-safety</> command-line option to
4714-
<filename>configure</filename>. (You might need to use other threading
4715-
command-line options to compile your client code.)
4712+
The <application>ecpg</application> library is thread-safe by
4713+
default. However, you might need to use some threading
4714+
command-line options to compile your client code.
47164715
</para>
47174716
</sect1>
47184717

‎doc/src/sgml/installation.sgml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.327 2009/08/12 16:32:35 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.328 2009/12/02 14:07:25 momjian Exp $ -->
22

33
<chapter id="installation">
44
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -1164,14 +1164,13 @@ su - postgres
11641164
</varlistentry>
11651165

11661166
<varlistentry>
1167-
<term><option>--enable-thread-safety</option></term>
1167+
<term><option>--disable-thread-safety</option></term>
11681168
<listitem>
11691169
<para>
1170-
Make the client libraries thread-safe. Thisallows
1170+
Disable thethread-safety ofclient libraries. Thisprevents
11711171
concurrent threads in <application>libpq</application> and
1172-
<application>ECPG</application> programs to safely control
1173-
their private connection handles. This option requires adequate
1174-
threading support in your operating system.
1172+
<application>ECPG</application> programs from safely controlling
1173+
their private connection handles.
11751174
</para>
11761175
</listitem>
11771176
</varlistentry>
@@ -2835,12 +2834,10 @@ MANPATH=/usr/lib/scohelp/%L/man:/usr/dt/man:/usr/man:/usr/share/man:scohelp:/usr
28352834
</sect3>
28362835

28372836
<sect3>
2838-
<title><option>--enable-thread-safety</option> and UnixWare</title>
2837+
<title>Threading on UnixWare</title>
28392838

28402839
<para>
2841-
If you use the <command>configure</command>
2842-
option <option>--enable-thread-safety</option>,
2843-
you <emphasis>must</emphasis> use <option>-Kpthread</option>
2840+
For threading, you<emphasis>must</emphasis> use <option>-Kpthread</option>
28442841
on <emphasis>all</emphasis> libpq-using programs. libpq
28452842
uses <function>pthread_*</function> calls, which are only
28462843
available with the

‎doc/src/sgml/libpq.sgml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.291 2009/12/0204:54:10 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.292 2009/12/0214:07:25 momjian Exp $ -->
22

33
<chapter id="libpq">
44
<title><application>libpq</application> - C Library</title>
@@ -6579,11 +6579,8 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
65796579
</indexterm>
65806580

65816581
<para>
6582-
<application>libpq</application> is reentrant and thread-safe if the
6583-
<filename>configure</filename> command-line option
6584-
<literal>--enable-thread-safety</> was used when the
6585-
<productname>PostgreSQL</productname> distribution was built. In
6586-
addition, you might need to use additional compiler command-line
6582+
<application>libpq</application> is reentrant and thread-safe by default.
6583+
You might need to use special compiler command-line
65876584
options when you compile your application code. Refer to your
65886585
system's documentation for information about how to build
65896586
thread-enabled applications, or look in

‎src/test/thread/README

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
$PostgreSQL: pgsql/src/test/thread/README,v 1.2 2008/03/21 13:23:29 momjian Exp $
1+
$PostgreSQL: pgsql/src/test/thread/README,v 1.3 2009/12/02 14:07:26 momjian Exp $
22

33
Threading
44
=========
55

6-
This programshould berun bydevelopers wishingtoenablethreadingon
7-
new platforms.
6+
This programisrun byconfiguretodetermine ifthreadingis
7+
properly supported on the platform.
88

9-
Run thread_test program to determine if your native libc functions are
10-
thread-safe, or if we should use *_r functions or thread locking.
9+
You can run the program manually to see details, which shows if your
10+
native libc functions are thread-safe, or if we use *_r functions or
11+
thread locking.
1112

12-
To use this program, you must:
13+
To use this program manually, you must:
1314

14-
o run "configure --enable-thread-safety"
15+
o run "configure"
1516
o compile the main source tree
1617
o compile and run this program
1718

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp