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

Commitd56b736

Browse files
committed
Update thread test to do getpid() in while loop, also use weather.com
rather than slashdot.org for testing.
1 parent8efbe30 commitd56b736

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎src/tools/thread/thread_test.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
*$PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.9 2004/03/28 02:37:31 momjian Exp $
9+
*$PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.10 2004/04/04 17:23:54 momjian Exp $
1010
*
1111
*This program tests to see if your standard libc functions use
1212
*pthread_setspecific()/pthread_getspecific() to be thread-safe.
@@ -105,7 +105,7 @@ void func_call_1(void) {
105105
/* wait for other thread to set errno */
106106
errno1_set=1;
107107
while (errno2_set==0)
108-
/*loop */;
108+
getpid();/*force system call */
109109
if (errno!=EEXIST)
110110
{
111111
fprintf(stderr,"errno not thread-safe; exiting\n");
@@ -128,8 +128,8 @@ void func_call_1(void) {
128128
passwd_p1=NULL;/* force thread-safe failure report */
129129
}
130130

131-
hostent_p1=gethostbyname("yahoo.com");
132-
p=gethostbyname("slashdot.org");
131+
hostent_p1=gethostbyname("www.yahoo.com");
132+
p=gethostbyname("www.weather.com");
133133
if (hostent_p1!=p)
134134
{
135135
printf("Your gethostbyname() changes the static memory area between calls\n");
@@ -151,7 +151,7 @@ void func_call_2(void) {
151151
/* wait for other thread to set errno */
152152
errno2_set=1;
153153
while (errno1_set==0)
154-
/*loop */;
154+
getpid();/*force system call */
155155
if (errno!=ENOENT)
156156
{
157157
fprintf(stderr,"errno not thread-safe; exiting\n");
@@ -174,8 +174,8 @@ void func_call_2(void) {
174174
passwd_p2=NULL;/* force thread-safe failure report */
175175
}
176176

177-
hostent_p2=gethostbyname("google.com");
178-
p=gethostbyname("postgresql.org");
177+
hostent_p2=gethostbyname("www.google.com");
178+
p=gethostbyname("www.postgresql.org");
179179
if (hostent_p2!=p)
180180
{
181181
printf("Your gethostbyname() changes the static memory area between calls\n");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp