RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Ralf S. Engelschall Root: /v/rpm/cvs Email: r...@rpm5.org Module: rpm Date: 07-Mar-2009 14:38:10 Branch: HEAD Handle: 2009030713380901 Modified files: rpm CHANGES configure.ac system.h rpm/lib fsm.c psm.c rpm/rpmio iosm.c rpmdav.c rpmdav.h rpmsq.c yarn.c Log: Use Pthreads under --with-pthreads controlled WITH_PTHREADS and not <pthreads.h> existance-derived HAVE_PTHREADS_H. This way one can still disable Pthreads usage under a platform where <pthreads.h> exists. Summary: Revision Changes Path 1.2807 +1 -0 rpm/CHANGES 2.343 +1 -0 rpm/configure.ac 2.181 +2 -2 rpm/lib/fsm.c 2.344 +2 -2 rpm/lib/psm.c 1.33 +2 -2 rpm/rpmio/iosm.c 2.94 +2 -2 rpm/rpmio/rpmdav.c 2.35 +1 -1 rpm/rpmio/rpmdav.h 1.42 +7 -7 rpm/rpmio/rpmsq.c 2.6 +9 -9 rpm/rpmio/yarn.c 2.115 +2 -0 rpm/system.h ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2806 -r1.2807 CHANGES --- rpm/CHANGES 6 Mar 2009 22:37:02 -0000 1.2806 +++ rpm/CHANGES 7 Mar 2009 13:38:09 -0000 1.2807 @@ -1,5 +1,6 @@ 5.2a2 -> 5.2a3: + - rse: use Pthreads under --with-pthreads controlled WITH_PTHREADS and not <pthreads.h> existance-derived HAVE_PTHREADS_H - jbj: update po files (Translation Project). - jbj: yarn: lobotomize yarn.c conditioned on HAVE_PTHREAD_H. - jbj: rpmz: toss the pbzip2 carcass into the compression cassoulet ... @@ . patch -p0 <<'@@ .' Index: rpm/configure.ac ============================================================================ $ cvs diff -u -r2.342 -r2.343 configure.ac --- rpm/configure.ac 6 Mar 2009 18:27:37 -0000 2.342 +++ rpm/configure.ac 7 Mar 2009 13:38:09 -0000 2.343 @@ -603,6 +603,7 @@ AS_HELP_STRING([--without-pthreads], [build RPM without POSIX pthreads]), [ WITH_PTHREADS="$withval" ], [ WITH_PTHREADS=yes ]) if test ".$WITH_PTHREADS" = .yes; then + AC_DEFINE(WITH_PTHREADS, 1, [Define to 1 for using Pthreads]) AC_CHECK_HEADERS(thread.h pthread.h synch.h semaphore.h) AC_CHECK_LIB(pthread, pthread_mutex_trylock, [], [ AC_CHECK_LIB(pthread, __pthread_mutex_trylock, [], [ @@ . patch -p0 <<'@@ .' Index: rpm/lib/fsm.c ============================================================================ $ cvs diff -u -r2.180 -r2.181 fsm.c --- rpm/lib/fsm.c 20 Dec 2008 08:09:47 -0000 2.180 +++ rpm/lib/fsm.c 7 Mar 2009 13:38:09 -0000 2.181 @@ -410,7 +410,7 @@ return dn; } -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) static void * fsmThread(void * arg) /*...@globals h_errno, fileSystem, internalState @*/ /*...@modifies arg, fileSystem, internalState @*/ @@ -427,7 +427,7 @@ /*...@modifies fsm, fileSystem, internalState @*/ { fsm->nstage = nstage; -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) if (fsm->multithreaded) return rpmsqJoin( rpmsqThread(fsmThread, fsm) ); #endif @@ . patch -p0 <<'@@ .' Index: rpm/lib/psm.c ============================================================================ $ cvs diff -u -r2.343 -r2.344 psm.c --- rpm/lib/psm.c 29 Dec 2008 22:42:25 -0000 2.343 +++ rpm/lib/psm.c 7 Mar 2009 13:38:09 -0000 2.344 @@ -1924,7 +1924,7 @@ return 0; } -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) static void * rpmpsmThread(void * arg) /*...@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*...@modifies arg, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -1941,7 +1941,7 @@ /*...@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/ { psm->nstage = nstage; -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) if (_psm_threads) return rpmsqJoin( rpmsqThread(rpmpsmThread, psm) ); #endif @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/iosm.c ============================================================================ $ cvs diff -u -r1.32 -r1.33 iosm.c --- rpm/rpmio/iosm.c 16 Dec 2008 22:18:12 -0000 1.32 +++ rpm/rpmio/iosm.c 7 Mar 2009 13:38:10 -0000 1.33 @@ -437,7 +437,7 @@ return dn; } -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) static void * iosmThread(void * arg) /*...@globals h_errno, fileSystem, internalState @*/ /*...@modifies arg, fileSystem, internalState @*/ @@ -454,7 +454,7 @@ /*...@modifies iosm, fileSystem, internalState @*/ { iosm->nstage = nstage; -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) if (iosm->multithreaded) return rpmsqJoin( rpmsqThread(iosmThread, iosm) ); #endif @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmdav.c ============================================================================ $ cvs diff -u -r2.93 -r2.94 rpmdav.c --- rpm/rpmio/rpmdav.c 20 Dec 2008 00:51:46 -0000 2.93 +++ rpm/rpmio/rpmdav.c 7 Mar 2009 13:38:10 -0000 2.94 @@ -175,7 +175,7 @@ if (_av_debug) fprintf(stderr, "*** avClosedir(%p)\n", avdir); -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) /*...@-moduncon -noeffectuncon @*/ (void) pthread_mutex_destroy(&avdir->lock); /*...@=moduncon =noeffectuncon @*/ @@ -274,7 +274,7 @@ /* Hash the directory path for a d_ino analogue. */ avdir->filepos = hashFunctionString(0, path, 0); -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) /*...@-moduncon -noeffectuncon -nullpass @*/ (void) pthread_mutex_init(&avdir->lock, NULL); /*...@=moduncon =noeffectuncon =nullpass @*/ @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmdav.h ============================================================================ $ cvs diff -u -r2.34 -r2.35 rpmdav.h --- rpm/rpmio/rpmdav.h 30 Oct 2008 15:56:21 -0000 2.34 +++ rpm/rpmio/rpmdav.h 7 Mar 2009 13:38:10 -0000 2.35 @@ -26,7 +26,7 @@ size_t size; /* Total valid data in the block. */ size_t offset; /* Current offset into the block. */ off_t filepos; /* Position of next entry to read. */ -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) pthread_mutex_t lock; /* Mutex lock for this structure. */ #endif }; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmsq.c ============================================================================ $ cvs diff -u -r1.41 -r1.42 rpmsq.c --- rpm/rpmio/rpmsq.c 19 Feb 2009 15:27:07 -0000 1.41 +++ rpm/rpmio/rpmsq.c 7 Mar 2009 13:38:10 -0000 1.42 @@ -190,7 +190,7 @@ #define remque(_e) __remque(_e) #endif -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) # if !defined(__QNX__) /* XXX suggested in bugzilla #159024 */ @@ -266,7 +266,7 @@ return u.vp; } -#endif /* HAVE_PTHREAD_H */ +#endif /* WITH_PTHREADS */ #define _RPMSQ_INTERNAL #include <rpmsq.h> @@ -655,7 +655,7 @@ void * rpmsqThread(void * (*start) (void * arg), void * arg) { -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) pthread_t pth; int ret; @@ -670,7 +670,7 @@ int rpmsqJoin(void * thread) { -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) pthread_t pth = (pthread_t) thread; if (thread == NULL) return EINVAL; @@ -683,7 +683,7 @@ int rpmsqThreadEqual(void * thread) { -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) pthread_t t1 = (pthread_t) thread; pthread_t t2 = pthread_self(); return pthread_equal(t1, t2); @@ -696,7 +696,7 @@ /** * SIGCHLD cancellation handler. */ -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) static void sigchld_cancel (void *arg) /*...@globals rpmsigTbl, fileSystem, internalState @*/ @@ -729,7 +729,7 @@ /*...@globals rpmsigTbl @*/ /*...@modifies rpmsigTbl @*/ { -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) int oldtype; #endif int status = -1; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/yarn.c ============================================================================ $ cvs diff -u -r2.5 -r2.6 yarn.c --- rpm/rpmio/yarn.c 6 Mar 2009 22:23:56 -0000 2.5 +++ rpm/rpmio/yarn.c 7 Mar 2009 13:38:10 -0000 2.6 @@ -18,23 +18,23 @@ #include "system.h" /* for thread portability */ -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) #if !defined(_POSIX_PTHREAD_SEMANTICS) #define _POSIX_PTHREAD_SEMANTICS #endif #if !defined(_REENTRANT) #define _REENTRANT #endif -#else /* HAVE_PTHREAD_H */ +#else /* WITH_PTHREADS */ #undef _POSIX_PTHREAD_SEMANTICS #undef _REENTRANT -#endif /* HAVE_PTHREAD_H */ +#endif /* WITH_PTHREADS */ /* external libraries and entities referenced */ #include <stdio.h> /* fprintf(), stderr */ #include <stdlib.h> /* exit(), malloc(), free(), NULL */ -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) /*...@-incondefs@*/ #include <pthread.h> /* pthread_t, pthread_create(), pthread_join(), */ @@ -47,7 +47,7 @@ pthread_cond_broadcast(), pthread_cond_wait(), pthread_cond_destroy() */ /*...@=incondefs@*/ -#else /* HAVE_PTHREAD_H */ +#else /* WITH_PTHREADS */ #define pthread_t int #define pthread_self() 0 @@ -78,7 +78,7 @@ #define pthread_cond_wait(__cond, __mutex) (-1) #define pthread_cond_broadcast(__cond) (-1) -#endif /* HAVE_PTHREAD_H */ +#endif /* WITH_PTHREADS */ #include <errno.h> /* ENOMEM, EAGAIN, EINVAL */ @@ -361,7 +361,7 @@ }; /* mark the calling thread as done and alert yarnJoinAll() */ -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) static void yarnReenter(/*...@unused@*/ void * dummy) /*...@globals threads, threads_lock, fileSystem, internalState @*/ /*...@modifies threads, threads_lock, fileSystem, internalState @*/ @@ -400,7 +400,7 @@ the thread resources can be released -- use cleanup stack so that the marking occurs even if the thread is cancelled */ /*...@null@*/ -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) static void * yarnIgnition(/*...@only@*/ void * arg) /*...@*/ { @@ -436,7 +436,7 @@ int ret; yarnThread th; struct capsule * capsule; -#if defined(HAVE_PTHREAD_H) +#if defined(WITH_PTHREADS) pthread_attr_t attr; #endif @@ . patch -p0 <<'@@ .' Index: rpm/system.h ============================================================================ $ cvs diff -u -r2.114 -r2.115 system.h --- rpm/system.h 17 Feb 2009 21:25:06 -0000 2.114 +++ rpm/system.h 7 Mar 2009 13:38:09 -0000 2.115 @@ -731,9 +731,11 @@ #define Makedev(x,y) makedev((x),(y)) #endif +#if defined(WITH_PTHREADS) #if defined(HAVE_PTHREAD_H) && !defined(__LCLINT__) #include <pthread.h> #endif +#endif /** * Mark --initdb and --verifydb for destruction. @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org