Skip to content

Commit 38eb180

Browse files
committed
Tighten casting of function call pointers for threads.
1 parent ee4ae6c commit 38eb180

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/template/linux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CFLAGS=-O2
22

33
SUPPORTS_THREADS=yes
4-
NEED_REENTRANT_FUNC_NAMES=yes
4+
NEED_REENTRANT_FUNC_NAMES=yes # verified glibc 2.1 2003-09-03
55
THREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
66
THREAD_LIBS="-lpthread"
77

src/tools/test_thread_funcs.c

Lines changed: 3 additions & 3 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-
* $Header: /cvsroot/pgsql/src/tools/Attic/test_thread_funcs.c,v 1.2 2003/09/03 19:36:31 momjian Exp $
9+
* $Header: /cvsroot/pgsql/src/tools/Attic/test_thread_funcs.c,v 1.3 2003/09/03 22:34:08 momjian Exp $
1010
*
1111
* This program tests to see if your standard libc functions use
1212
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
@@ -57,8 +57,8 @@ int main(int argc, char *argv[])
5757
return 1;
5858
}
5959

60-
pthread_create(&thread1, NULL, (void *) func_call_1, NULL);
61-
pthread_create(&thread2, NULL, (void *) func_call_2, NULL);
60+
pthread_create(&thread1, NULL, (void * (*)(void *)) func_call_1, NULL);
61+
pthread_create(&thread2, NULL, (void * (*)(void *)) func_call_2, NULL);
6262
pthread_join(thread1, NULL);
6363
pthread_join(thread2, NULL);
6464

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy