2009-10-25 Ralf Corsépius <ralf.corsepius@rtems.org>

* configure.ac: Check for pthread_rwlock_unlock in pthread.h.
	* psxrwlock01/test.c: Conditionally add local prototype for
	pthread_rwlock_unlock() if pthread.h doesn't supply it.
This commit is contained in:
Ralf Corsepius
2009-10-25 06:51:02 +00:00
parent 58f29d52ee
commit cd06fd586e
2 changed files with 8 additions and 0 deletions

View File

@@ -27,6 +27,9 @@ AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"])
RTEMS_CHECK_CPUOPTS([RTEMS_POSIX_API])
AM_CONDITIONAL(HAS_POSIX,test x"${rtems_cv_RTEMS_POSIX_API}" = x"yes")
# FIXME: newlib should supply declaration of pthread_rwlock_unlock()
AC_CHECK_DECLS([pthread_rwlock_unlock],[],[],[[#include <pthread.h>]])
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile
psx01/Makefile

View File

@@ -19,6 +19,11 @@
/* #define __USE_XOPEN2K XXX already defined on GNU/Linux */
#include <pthread.h>
#if !HAVE_DECL_PTHREAD_RWLOCK_UNLOCK
/* FIXME: Newlib should provide the decl. */
extern int pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
#endif
#define NUMBER_THREADS 2
pthread_t ThreadIds[NUMBER_THREADS];
pthread_rwlock_t RWLock;