|
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 | | -void func_call_1(void); |
70 | | -void func_call_2(void); |
| 69 | +static void func_call_1(void); |
| 70 | +static void func_call_2(void); |
71 | 71 |
|
72 | 72 | #define TEMP_FILENAME_1 "/tmp/thread_test.1.XXXXXX" |
73 | 73 | #define TEMP_FILENAME_2 "/tmp/thread_test.2.XXXXXX" |
74 | 74 |
|
75 | | -char *temp_filename_1; |
76 | | -char *temp_filename_2; |
| 75 | +static char *temp_filename_1; |
| 76 | +static char *temp_filename_2; |
77 | 77 |
|
78 | | -pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER; |
| 78 | +static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER; |
79 | 79 |
|
80 | | -volatile int thread1_done = 0; |
81 | | -volatile int thread2_done = 0; |
| 80 | +static volatile int thread1_done = 0; |
| 81 | +static volatile int thread2_done = 0; |
82 | 82 |
|
83 | | -volatile int errno1_set = 0; |
84 | | -volatile int errno2_set = 0; |
| 83 | +static volatile int errno1_set = 0; |
| 84 | +static volatile int errno2_set = 0; |
85 | 85 |
|
86 | 86 | #ifndef HAVE_STRERROR_R |
87 | | -char *strerror_p1; |
88 | | -char *strerror_p2; |
89 | | -bool strerror_threadsafe = false; |
| 87 | +static char *strerror_p1; |
| 88 | +static char *strerror_p2; |
| 89 | +static bool strerror_threadsafe = false; |
90 | 90 | #endif |
91 | 91 |
|
92 | 92 | #ifndef HAVE_GETPWUID_R |
93 | | -struct passwd *passwd_p1; |
94 | | -struct passwd *passwd_p2; |
95 | | -bool getpwuid_threadsafe = false; |
| 93 | +static struct passwd *passwd_p1; |
| 94 | +static struct passwd *passwd_p2; |
| 95 | +static bool getpwuid_threadsafe = false; |
96 | 96 | #endif |
97 | 97 |
|
98 | 98 | #if !defined(HAVE_GETADDRINFO) && !defined(HAVE_GETHOSTBYNAME_R) |
99 | | -struct hostent *hostent_p1; |
100 | | -struct hostent *hostent_p2; |
101 | | -char myhostname[MAXHOSTNAMELEN]; |
102 | | -bool gethostbyname_threadsafe = false; |
| 99 | +static struct hostent *hostent_p1; |
| 100 | +static struct hostent *hostent_p2; |
| 101 | +static char myhostname[MAXHOSTNAMELEN]; |
| 102 | +static bool gethostbyname_threadsafe = false; |
103 | 103 | #endif |
104 | 104 |
|
105 | | -bool platform_is_threadsafe = true; |
| 105 | +static bool platform_is_threadsafe = true; |
106 | 106 |
|
107 | 107 | int |
108 | 108 | main(int argc, char *argv[]) |
@@ -230,7 +230,7 @@ main(int argc, char *argv[]) |
230 | 230 | } |
231 | 231 | } |
232 | 232 |
|
233 | | -void |
| 233 | +static void |
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 | +static void |
305 | 305 | func_call_2(void) |
306 | 306 | { |
307 | 307 | #if !defined(HAVE_GETPWUID_R) || \ |
|
0 commit comments