Hi zthreads,
Please use the attached patch to your source code. Your source code
fails to build with clang.
--
Best regards
Alexander
--- zthreads-2.3.2/include/zthread/Guard.h 2014-03-13 10:04:47.000000000
-0400
+++ zthreads-2.3.2-my/include/zthread/Guard.h 2014-03-13 09:33:14.674235303
-0400
@@ -108,7 +108,7 @@
}
template <class LockType>
- static void createScope(LockHolder<LockType>& l, unsigned long ms) {
+ static bool createScope(LockHolder<LockType>& l, unsigned long ms) {
if(Scope1::createScope(l, ms))
if(!Scope2::createScope(l, ms)) {
--- zthreads-2.3.2/src/linux/FastRecursiveLock.h 2005-03-12
22:47:52.000000000 -0500
+++ zthreads-2.3.2-my/src/linux/FastRecursiveLock.h 2014-03-13
09:35:20.243098564 -0400
@@ -46,7 +46,7 @@
inline FastRecursiveLock() {
- static const pthread_mutexattr_t attr = { PTHREAD_MUTEX_RECURSIVE_NP };
+ static const pthread_mutexattr_t attr = {{ PTHREAD_MUTEX_RECURSIVE_NP }};
pthread_mutex_init(&_mtx, &attr);
}
--- zthreads-2.3.2/src/posix/ThreadOps.cxx 2005-03-12 22:43:01.000000000
-0500
+++ zthreads-2.3.2-my/src/posix/ThreadOps.cxx 2014-03-13 09:37:29.048101441
-0400
@@ -103,7 +103,7 @@
struct sched_param param;
int policy = SCHED_OTHER;
- if(result = (pthread_getschedparam(impl->_tid, &policy, ¶m) == 0)) {
+ if((result = (pthread_getschedparam(impl->_tid, &policy, ¶m) == 0))) {
// Convert to one of the PRIORITY values
if(param.sched_priority < 10)
--- zthreads-2.3.2/src/ThreadQueue.cxx 2005-03-12 22:55:23.000000000 -0500
+++ zthreads-2.3.2-my/src/ThreadQueue.cxx 2014-03-13 09:40:07.697310171
-0400
@@ -140,10 +140,16 @@
// Wake the main thread,if its waiting, when the last pending-thread
becomes available;
// Otherwise, take note that no wait for pending threads to finish is
needed
if(_userThreads.empty())
+ {
if(_waiter && _waiter != (ThreadImpl*)1)
+ {
_waiter->getMonitor().notify();
+ }
else
+ {
_waiter = (ThreadImpl*)!_waiter;
+ }
+ }
ZTDEBUG("1 pending-thread added.\n");