1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-31 17:02:12 +03:00

Finalize configuration of thread_test program.

This commit is contained in:
Bruce Momjian
2003-09-27 16:24:45 +00:00
parent a6790ce857
commit 391dceb462
13 changed files with 39 additions and 30 deletions

View File

@@ -4,7 +4,7 @@
#
# Copyright (C) 2003 by PostgreSQL Global Development Team
#
# $Header: /cvsroot/pgsql/src/tools/thread/Attic/Makefile,v 1.1 2003/09/27 15:32:48 momjian Exp $
# $Header: /cvsroot/pgsql/src/tools/thread/Attic/Makefile,v 1.2 2003/09/27 16:24:45 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -12,6 +12,13 @@ subdir = tools/thread
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
ifeq ($(THREAD_SUPPORT), no)
$(error Your platform does not support threads)
endif
ifeq ($(THREAD_SUPPORT), )
$(error You have not configured your template/$$port file. See the README)
endif
override CFLAGS += $(THREAD_CPPFLAGS)
LDFLAGS += $(THREAD_LIBS)

View File

@@ -4,5 +4,10 @@ new platforms.
Run thread_test program to determine if your native libc functions are
thread-safe, or if we should use *_r functions or thread locking.
Make sure you have added any needed 'THREAD_CPPFLAGS' and 'THREAD_LIBS'
defines to your template/${port} file before compiling this program.
To use this program, you must:
o add "THREAD_SUPPORT=yes" to your template/${port} file
o add any THREAD_CPPFLAGS and THREAD_LIBS defines to your
template/${port} file
o run "configure --enable-thread-safety"
o compile and run this program

View File

@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/tools/thread/Attic/thread_test.c,v 1.1 2003/09/27 15:32:48 momjian Exp $
* $Header: /cvsroot/pgsql/src/tools/thread/Attic/thread_test.c,v 1.2 2003/09/27 16:24:45 momjian Exp $
*
* This program tests to see if your standard libc functions use
* pthread_setspecific()/pthread_getspecific() to be thread-safe.
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
printf("\
Make sure you have added any needed 'THREAD_CPPFLAGS' and 'THREAD_LIBS'\n\
defines to your template/${port} file before compiling this program.\n\n"
defines to your template/$port file before compiling this program.\n\n"
);
pthread_create(&thread1, NULL, (void * (*)(void *)) func_call_1, NULL);
pthread_create(&thread2, NULL, (void * (*)(void *)) func_call_2, NULL);
@@ -82,20 +82,14 @@ defines to your template/${port} file before compiling this program.\n\n"
strerror_p1 != strerror_p2)
{
printf("All your non-*_r functions are thread-safe.\n");
printf("Add this to your template/${port} file:\n\n");
printf("\
SUPPORTS_THREADS=yes\n\
NEED_REENTRANT_FUNCS=no\n"
);
printf("Add this to your template/$port file:\n\n");
printf("NEED_REENTRANT_FUNCS=no\n");
}
else
{
printf("Not all non-*_r functions are thread-safe.\n");
printf("Add this to your template/${port} file:\n\n");
printf("\
SUPPORTS_THREADS=yes\n\
NEED_REENTRANT_FUNCS=yes\n"
);
printf("Add this to your template/$port file:\n\n");
printf("NEED_REENTRANT_FUNCS=yes\n");
}
return 0;