head 1.5; access; symbols pkgsrc-2017Q3:1.4.0.74 pkgsrc-2017Q3-base:1.4 pkgsrc-2017Q2:1.4.0.70 pkgsrc-2017Q2-base:1.4 pkgsrc-2017Q1:1.4.0.68 pkgsrc-2017Q1-base:1.4 pkgsrc-2016Q4:1.4.0.66 pkgsrc-2016Q4-base:1.4 pkgsrc-2016Q3:1.4.0.64 pkgsrc-2016Q3-base:1.4 pkgsrc-2016Q2:1.4.0.62 pkgsrc-2016Q2-base:1.4 pkgsrc-2016Q1:1.4.0.60 pkgsrc-2016Q1-base:1.4 pkgsrc-2015Q4:1.4.0.58 pkgsrc-2015Q4-base:1.4 pkgsrc-2015Q3:1.4.0.56 pkgsrc-2015Q3-base:1.4 pkgsrc-2015Q2:1.4.0.54 pkgsrc-2015Q2-base:1.4 pkgsrc-2015Q1:1.4.0.52 pkgsrc-2015Q1-base:1.4 pkgsrc-2014Q4:1.4.0.50 pkgsrc-2014Q4-base:1.4 pkgsrc-2014Q3:1.4.0.48 pkgsrc-2014Q3-base:1.4 pkgsrc-2014Q2:1.4.0.46 pkgsrc-2014Q2-base:1.4 pkgsrc-2014Q1:1.4.0.44 pkgsrc-2014Q1-base:1.4 pkgsrc-2013Q4:1.4.0.42 pkgsrc-2013Q4-base:1.4 pkgsrc-2013Q3:1.4.0.40 pkgsrc-2013Q3-base:1.4 pkgsrc-2013Q2:1.4.0.38 pkgsrc-2013Q2-base:1.4 pkgsrc-2013Q1:1.4.0.36 pkgsrc-2013Q1-base:1.4 pkgsrc-2012Q4:1.4.0.34 pkgsrc-2012Q4-base:1.4 pkgsrc-2012Q3:1.4.0.32 pkgsrc-2012Q3-base:1.4 pkgsrc-2012Q2:1.4.0.30 pkgsrc-2012Q2-base:1.4 pkgsrc-2012Q1:1.4.0.28 pkgsrc-2012Q1-base:1.4 pkgsrc-2011Q4:1.4.0.26 pkgsrc-2011Q4-base:1.4 pkgsrc-2011Q3:1.4.0.24 pkgsrc-2011Q3-base:1.4 pkgsrc-2011Q2:1.4.0.22 pkgsrc-2011Q2-base:1.4 pkgsrc-2011Q1:1.4.0.20 pkgsrc-2011Q1-base:1.4 pkgsrc-2010Q4:1.4.0.18 pkgsrc-2010Q4-base:1.4 pkgsrc-2010Q3:1.4.0.16 pkgsrc-2010Q3-base:1.4 pkgsrc-2010Q2:1.4.0.14 pkgsrc-2010Q2-base:1.4 pkgsrc-2010Q1:1.4.0.12 pkgsrc-2010Q1-base:1.4 pkgsrc-2009Q4:1.4.0.10 pkgsrc-2009Q4-base:1.4 pkgsrc-2009Q3:1.4.0.8 pkgsrc-2009Q3-base:1.4 pkgsrc-2009Q2:1.4.0.6 pkgsrc-2009Q2-base:1.4 pkgsrc-2009Q1:1.4.0.4 pkgsrc-2009Q1-base:1.4 pkgsrc-2008Q4:1.4.0.2 pkgsrc-2008Q4-base:1.4 pkgsrc-2008Q3:1.3.0.40 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.38 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.36 pkgsrc-2008Q2-base:1.3 cwrapper:1.3.0.34 pkgsrc-2008Q1:1.3.0.32 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.30 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.28 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.26 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.24 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.22 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.20 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.18 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.16 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.14 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.12 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.10 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.3.0.8 pkgsrc-2005Q1-base:1.3 pkgsrc-2004Q4:1.3.0.6 pkgsrc-2004Q4-base:1.3 pkgsrc-2004Q3:1.3.0.4 pkgsrc-2004Q3-base:1.3 pkgsrc-2004Q2:1.3.0.2 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.2.0.4 pkgsrc-2004Q1-base:1.2 pkgsrc-2003Q4:1.2.0.2 pkgsrc-2003Q4-base:1.2; locks; strict; comment @# @; 1.5 date 2017.09.26.10.26.54; author wiz; state dead; branches; next 1.4; commitid 9ARpkXTuh9Wg2H8A; 1.4 date 2008.10.28.11.32.07; author markd; state Exp; branches; next 1.3; 1.3 date 2004.04.20.12.15.51; author markd; state Exp; branches; next 1.2; 1.2 date 2003.07.09.15.13.03; author markd; state Exp; branches; next 1.1; 1.1 date 2003.07.07.20.51.55; author skrll; state Exp; branches; next ; desc @@ 1.5 log @*: remove qt3 and the packages using it, including KDE3 Announced in https://mail-index.netbsd.org/pkgsrc-users/2017/09/10/msg025556.html @ text @$NetBSD: patch-ah,v 1.4 2008/10/28 11:32:07 markd Exp $ --- mcop_mt/threads_posix.cc.orig 2005-09-10 20:13:32.000000000 +1200 +++ mcop_mt/threads_posix.cc @@@@ -27,13 +27,158 @@@@ /* only compile this if we have libpthread available */ #ifdef HAVE_LIBPTHREAD +#include #include #include #include #include #include +#include +#ifdef _POSIX_SEMAPHORES #include +#else + +#include +#include + +struct sem_t { + pthread_mutex_t lock; + pthread_cond_t gtzero; + unsigned int count; + unsigned int nwaiters; +}; + +static int sem_init(sem_t *, int, unsigned int); +static int sem_destroy(sem_t *); +static int sem_wait(sem_t *); +static int sem_trywait(sem_t *); +static int sem_post(sem_t *); +static int sem_getvalue(sem_t *, int *); + +static int +sem_init(sem_t *sem, int pshared, unsigned int value) +{ + + /* + * Range check the arguments. + */ + if (pshared != 0) { + errno = EPERM; + return -1; + } + + if (value > INT_MAX) { + errno = EINVAL; + return -1; + } + + /* + * Initialize the semaphore. + */ + if (pthread_mutex_init(&sem->lock, NULL) != 0) { + errno = ENOMEM; + return -1; + } + + if (pthread_cond_init(&sem->gtzero, NULL) != 0) { + pthread_mutex_destroy(&sem->lock); + errno = ENOMEM; + return -1; + } + + sem->count = value; + sem->nwaiters = 0; + + return 0; +} + +static int +sem_destroy(sem_t *sem) +{ + + /* Make sure there are no waiters. */ + pthread_mutex_lock(&sem->lock); + if (sem->nwaiters > 0) { + pthread_mutex_unlock(&sem->lock); + errno = EBUSY; + return -1; + } + pthread_mutex_unlock(&sem->lock); + + pthread_mutex_destroy(&sem->lock); + pthread_cond_destroy(&sem->gtzero); + + return 0; +} + +static int +sem_wait(sem_t *sem) +{ + pthread_testcancel(); + + pthread_mutex_lock(&sem->lock); + + while (sem->count == 0) { + sem->nwaiters++; + pthread_cond_wait(&sem->gtzero, &sem->lock); + } + sem->count--; + + pthread_mutex_unlock(&sem->lock); + + pthread_testcancel(); + return 0; +} + +static int +sem_trywait(sem_t *sem) +{ + int retval; + + pthread_mutex_lock(&sem->lock); + + if (sem->count > 0) { + sem->count--; + retval = 0; + } else { + errno = EAGAIN; + retval = -1; + } + + pthread_mutex_unlock(&sem->lock); + + return retval; +} + +static int +sem_post(sem_t *sem) +{ + pthread_mutex_lock(&sem->lock); + + sem->count++; + if (sem->nwaiters > 0) { + pthread_cond_broadcast(&sem->gtzero); + } + + pthread_mutex_unlock(&sem->lock); + + return 0; +} + +static int +sem_getvalue(sem_t *sem, int *sval) +{ + + pthread_mutex_lock(&sem->lock); + *sval = sem->count; + pthread_mutex_unlock(&sem->lock); + + return 0; +} +#endif + + #include #include @@@@ -186,10 +331,12 @@@@ public: Thread_impl(Thread *thread) : thread(thread) { } void setPriority(int priority) { +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING struct sched_param sp; sp.sched_priority = priority; if (pthread_setschedparam(pthread, SCHED_FIFO, &sp)) arts_debug("Thread::setPriority: sched_setscheduler failed"); +#endif } static pthread_key_t privateDataKey; static void *threadStartInternal(void *impl) @ 1.4 log @Fix build on NetBSD against glib2-2.18.2. PR pkg/39801 @ text @d1 1 a1 1 $NetBSD: patch-ah,v 1.3 2004/04/20 12:15:51 markd Exp $ @ 1.3 log @bl3ify and update to version 1.2.2 (part of kde 3.2.2) Changes: ALSA: Make aRts work through DMix-devices @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 --- mcop_mt/threads_posix.cc.orig 2004-04-04 19:37:55.000000000 +1200 d5 8 a12 1 @@@@ -33,7 +33,151 @@@@ d164 1 a164 1 @@@@ -186,10 +330,12 @@@@ public: @ 1.2 log @Add a missing include. @ text @d1 1 a1 1 $NetBSD: patch-ah,v 1.1 2003/07/07 20:51:55 skrll Exp $ d3 1 a3 1 --- mcop_mt/threads_posix.cc.orig 2002-03-25 22:13:17.000000000 +0000 d5 3 a7 3 @@@@ -34,7 +34,151 @@@@ #endif d157 1 a157 1 @@@@ -187,10 +330,12 @@@@ public: @ 1.1 log @Fix (at least) artsd on -current. The s/mcop_mt/mcop/ hack that worked with pth doesn't work in -current. Make libmcop_mt build with pre-current and pth by providing sem_* calls based on a mutex and a condition variable. @ text @d1 1 a1 1 $NetBSD$ d5 1 a5 1 @@@@ -34,7 +34,150 @@@@ d15 1 @