|
6 | 6 | * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group |
7 | 7 | * Portions Copyright (c) 1994, Regents of the University of California |
8 | 8 | * |
9 | | - *$PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.36 2004/12/31 22:04:02 pgsql Exp $ |
| 9 | + *$PostgreSQL: pgsql/src/tools/thread/thread_test.c,v 1.37 2005/03/11 15:25:31 momjian Exp $ |
10 | 10 | * |
11 | 11 | *This program tests to see if your standard libc functions use |
12 | 12 | *pthread_setspecific()/pthread_getspecific() to be thread-safe. |
@@ -66,43 +66,43 @@ main(int argc, char *argv[]) |
66 | 66 | /* This must be down here because this is the code that uses threads. */ |
67 | 67 | #include<pthread.h> |
68 | 68 |
|
69 | | -voidfunc_call_1(void); |
70 | | -voidfunc_call_2(void); |
| 69 | +staticvoidfunc_call_1(void); |
| 70 | +staticvoidfunc_call_2(void); |
71 | 71 |
|
72 | 72 | #defineTEMP_FILENAME_1 "/tmp/thread_test.1.XXXXXX" |
73 | 73 | #defineTEMP_FILENAME_2 "/tmp/thread_test.2.XXXXXX" |
74 | 74 |
|
75 | | -char*temp_filename_1; |
76 | | -char*temp_filename_2; |
| 75 | +staticchar*temp_filename_1; |
| 76 | +staticchar*temp_filename_2; |
77 | 77 |
|
78 | | -pthread_mutex_tinit_mutex=PTHREAD_MUTEX_INITIALIZER; |
| 78 | +staticpthread_mutex_tinit_mutex=PTHREAD_MUTEX_INITIALIZER; |
79 | 79 |
|
80 | | -volatileintthread1_done=0; |
81 | | -volatileintthread2_done=0; |
| 80 | +staticvolatileintthread1_done=0; |
| 81 | +staticvolatileintthread2_done=0; |
82 | 82 |
|
83 | | -volatileinterrno1_set=0; |
84 | | -volatileinterrno2_set=0; |
| 83 | +staticvolatileinterrno1_set=0; |
| 84 | +staticvolatileinterrno2_set=0; |
85 | 85 |
|
86 | 86 | #ifndefHAVE_STRERROR_R |
87 | | -char*strerror_p1; |
88 | | -char*strerror_p2; |
89 | | -boolstrerror_threadsafe= false; |
| 87 | +staticchar*strerror_p1; |
| 88 | +staticchar*strerror_p2; |
| 89 | +staticboolstrerror_threadsafe= false; |
90 | 90 | #endif |
91 | 91 |
|
92 | 92 | #ifndefHAVE_GETPWUID_R |
93 | | -structpasswd*passwd_p1; |
94 | | -structpasswd*passwd_p2; |
95 | | -boolgetpwuid_threadsafe= false; |
| 93 | +staticstructpasswd*passwd_p1; |
| 94 | +staticstructpasswd*passwd_p2; |
| 95 | +staticboolgetpwuid_threadsafe= false; |
96 | 96 | #endif |
97 | 97 |
|
98 | 98 | #if !defined(HAVE_GETADDRINFO)&& !defined(HAVE_GETHOSTBYNAME_R) |
99 | | -structhostent*hostent_p1; |
100 | | -structhostent*hostent_p2; |
101 | | -charmyhostname[MAXHOSTNAMELEN]; |
102 | | -boolgethostbyname_threadsafe= false; |
| 99 | +staticstructhostent*hostent_p1; |
| 100 | +staticstructhostent*hostent_p2; |
| 101 | +staticcharmyhostname[MAXHOSTNAMELEN]; |
| 102 | +staticboolgethostbyname_threadsafe= false; |
103 | 103 | #endif |
104 | 104 |
|
105 | | -boolplatform_is_threadsafe= true; |
| 105 | +staticboolplatform_is_threadsafe= true; |
106 | 106 |
|
107 | 107 | int |
108 | 108 | main(intargc,char*argv[]) |
@@ -230,7 +230,7 @@ main(int argc, char *argv[]) |
230 | 230 | } |
231 | 231 | } |
232 | 232 |
|
233 | | -void |
| 233 | +staticvoid |
234 | 234 | func_call_1(void) |
235 | 235 | { |
236 | 236 | #if !defined(HAVE_GETPWUID_R)|| \ |
@@ -301,7 +301,7 @@ func_call_1(void) |
301 | 301 | } |
302 | 302 |
|
303 | 303 |
|
304 | | -void |
| 304 | +staticvoid |
305 | 305 | func_call_2(void) |
306 | 306 | { |
307 | 307 | #if !defined(HAVE_GETPWUID_R)|| \ |
|