head 1.1; access; symbols OPENPKG_E1_MP_HEAD:1.1 OPENPKG_E1_MP:1.1 OPENPKG_E1_MP_2_STABLE:1.1.2.2 OPENPKG_E1_FP:1.1.2.2 OPENPKG_2_STABLE_MP:1.1 OPENPKG_2_STABLE_20061018:1.1.2.2 OPENPKG_2_STABLE:1.1.0.2 OPENPKG_CW_FP:1.1 OPENPKG_1_STABLE_MP:1.1; locks; strict; comment @# @; 1.1 date 2003.07.22.14.21.05; author rse; state Exp; branches 1.1.2.1; next ; 1.1.2.1 date 2003.07.22.14.21.05; author rse; state dead; branches; next 1.1.2.2; commitid iZxwRSmmWscPXUQr; 1.1.2.2 date 2006.10.16.14.58.17; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; desc @@ 1.1 log @use canonical filename for patch @ text @--- src/xercesc/runConfigure.dist 2003-05-27 17:04:47.000000000 +0200 +++ src/xercesc/runConfigure 2003-06-02 16:17:22.000000000 +0200 @@@@ -189,6 +189,7 @@@@ linkeroptions="$linkeroptions $2"; shift 2;; -P) + prefix=$2 configureoptions="$configureoptions --prefix=$2"; shift 2;; -C) @@@@ -303,8 +304,16 @@@@ ;; esac elif test $platform = "freebsd"; then - threadingLibs="-pthread -lc_r" - threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" + case $thread in + pth) + threadingLibs="-L$prefix/lib -lpth -lc_r" + threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS -DUSE_PTH -I$prefix/include" + ;; + *) + threadingLibs="-pthread -lc_r" + threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" + ;; + esac elif test $platform = "netbsd"; then threadingLibs="-pthread -lpthread" threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" --- src/xercesc/util/Platforms/FreeBSD/FreeBSDPlatformUtils.cpp.dist 2003-05-27 17:04:52.000000000 +0200 +++ src/xercesc/util/Platforms/FreeBSD/FreeBSDPlatformUtils.cpp 2003-06-02 16:15:22.000000000 +0200 @@@@ -113,8 +113,12 @@@@ // --------------------------------------------------------------------------- #if !defined(APP_NO_THREADS) +#ifdef USE_PTH +#include +#else #include #endif +#endif #ifndef _GNU_SOURCE #error _GNU_SOURCE is not defined in your compile settings @@@@ -506,6 +510,14 @@@@ void* XMLPlatformUtils::makeMutex() { +#ifdef USE_PTH + pth_mutex_t* mutex = new pth_mutex_t; + if (pth_mutex_init(mutex)) + { + ThrowXML(XMLPlatformUtilsException, + XMLExcepts::Mutex_CouldNotCreate); + } +#else pthread_mutex_t* mutex = new pthread_mutex_t; pthread_mutexattr_t* attr = new pthread_mutexattr_t; pthread_mutexattr_init(attr); @@@@ -517,20 +529,24 @@@@ } pthread_mutexattr_destroy(attr); delete attr; +#endif return (void*)(mutex); - } void XMLPlatformUtils::closeMutex(void* const mtxHandle) { if (mtxHandle != NULL) { +#ifdef USE_PTH + delete (pth_mutex_t*)mtxHandle; +#else if (pthread_mutex_destroy((pthread_mutex_t*) mtxHandle)) { ThrowXML(XMLPlatformUtilsException, XMLExcepts::Mutex_CouldNotDestroy); } delete (pthread_mutex_t*)mtxHandle; +#endif } } @@@@ -539,7 +555,11 @@@@ { if (mtxHandle != NULL) { +#ifdef USE_PTH + if (pth_mutex_acquire((pth_mutex_t*) mtxHandle, FALSE, NULL)) +#else if (pthread_mutex_lock((pthread_mutex_t*) mtxHandle)) +#endif { ThrowXML(XMLPlatformUtilsException, XMLExcepts::Mutex_CouldNotLock); @@@@ -552,7 +572,11 @@@@ { if (mtxHandle != NULL) { +#ifdef USE_PTH + if (pth_mutex_release((pth_mutex_t*) mtxHandle)) +#else if (pthread_mutex_unlock((pthread_mutex_t*) mtxHandle)) +#endif { ThrowXML(XMLPlatformUtilsException, XMLExcepts::Mutex_CouldNotUnlock); @ 1.1.2.1 log @file xerces-c.patch.pth was added on branch OPENPKG_2_STABLE on 2006-10-16 14:58:17 +0000 @ text @d1 109 @ 1.1.2.2 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @a0 109 --- src/xercesc/runConfigure.dist 2003-05-27 17:04:47.000000000 +0200 +++ src/xercesc/runConfigure 2003-06-02 16:17:22.000000000 +0200 @@@@ -189,6 +189,7 @@@@ linkeroptions="$linkeroptions $2"; shift 2;; -P) + prefix=$2 configureoptions="$configureoptions --prefix=$2"; shift 2;; -C) @@@@ -303,8 +304,16 @@@@ ;; esac elif test $platform = "freebsd"; then - threadingLibs="-pthread -lc_r" - threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" + case $thread in + pth) + threadingLibs="-L$prefix/lib -lpth -lc_r" + threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS -DUSE_PTH -I$prefix/include" + ;; + *) + threadingLibs="-pthread -lc_r" + threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" + ;; + esac elif test $platform = "netbsd"; then threadingLibs="-pthread -lpthread" threadingDefines="-D_THREAD_SAFE -DXML_USE_PTHREADS" --- src/xercesc/util/Platforms/FreeBSD/FreeBSDPlatformUtils.cpp.dist 2003-05-27 17:04:52.000000000 +0200 +++ src/xercesc/util/Platforms/FreeBSD/FreeBSDPlatformUtils.cpp 2003-06-02 16:15:22.000000000 +0200 @@@@ -113,8 +113,12 @@@@ // --------------------------------------------------------------------------- #if !defined(APP_NO_THREADS) +#ifdef USE_PTH +#include +#else #include #endif +#endif #ifndef _GNU_SOURCE #error _GNU_SOURCE is not defined in your compile settings @@@@ -506,6 +510,14 @@@@ void* XMLPlatformUtils::makeMutex() { +#ifdef USE_PTH + pth_mutex_t* mutex = new pth_mutex_t; + if (pth_mutex_init(mutex)) + { + ThrowXML(XMLPlatformUtilsException, + XMLExcepts::Mutex_CouldNotCreate); + } +#else pthread_mutex_t* mutex = new pthread_mutex_t; pthread_mutexattr_t* attr = new pthread_mutexattr_t; pthread_mutexattr_init(attr); @@@@ -517,20 +529,24 @@@@ } pthread_mutexattr_destroy(attr); delete attr; +#endif return (void*)(mutex); - } void XMLPlatformUtils::closeMutex(void* const mtxHandle) { if (mtxHandle != NULL) { +#ifdef USE_PTH + delete (pth_mutex_t*)mtxHandle; +#else if (pthread_mutex_destroy((pthread_mutex_t*) mtxHandle)) { ThrowXML(XMLPlatformUtilsException, XMLExcepts::Mutex_CouldNotDestroy); } delete (pthread_mutex_t*)mtxHandle; +#endif } } @@@@ -539,7 +555,11 @@@@ { if (mtxHandle != NULL) { +#ifdef USE_PTH + if (pth_mutex_acquire((pth_mutex_t*) mtxHandle, FALSE, NULL)) +#else if (pthread_mutex_lock((pthread_mutex_t*) mtxHandle)) +#endif { ThrowXML(XMLPlatformUtilsException, XMLExcepts::Mutex_CouldNotLock); @@@@ -552,7 +572,11 @@@@ { if (mtxHandle != NULL) { +#ifdef USE_PTH + if (pth_mutex_release((pth_mutex_t*) mtxHandle)) +#else if (pthread_mutex_unlock((pthread_mutex_t*) mtxHandle)) +#endif { ThrowXML(XMLPlatformUtilsException, XMLExcepts::Mutex_CouldNotUnlock); @