head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.54 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.52 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.50 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.48 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.46 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.2.0.44 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.42 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.40 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.38 pkgsrc-2008Q2-base:1.2 pkgsrc-2008Q1:1.2.0.36 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.34 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.32 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.30 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.28 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.26 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.2.0.24 pkgsrc-2006Q3-base:1.2 pkgsrc-2006Q2:1.2.0.22 pkgsrc-2006Q2-base:1.2 pkgsrc-2006Q1:1.2.0.20 pkgsrc-2006Q1-base:1.2 pkgsrc-2005Q4:1.2.0.18 pkgsrc-2005Q4-base:1.2 pkgsrc-2005Q3:1.2.0.16 pkgsrc-2005Q3-base:1.2 pkgsrc-2005Q2:1.2.0.14 pkgsrc-2005Q2-base:1.2 pkgsrc-2005Q1:1.2.0.12 pkgsrc-2005Q1-base:1.2 pkgsrc-2004Q4:1.2.0.10 pkgsrc-2004Q4-base:1.2 pkgsrc-2004Q3:1.2.0.8 pkgsrc-2004Q3-base:1.2 pkgsrc-2004Q2:1.2.0.6 pkgsrc-2004Q2-base:1.2 pkgsrc-2004Q1:1.2.0.4 pkgsrc-2004Q1-base:1.2 pkgsrc-2003Q4:1.2.0.2 pkgsrc-2003Q4-base:1.2 pkgviews:1.1.0.4 pkgviews-base:1.1 buildlink2-base:1.2 buildlink2:1.1.0.2; locks; strict; comment @# @; 1.2 date 2002.08.01.05.32.52; author jlam; state dead; branches; next 1.1; 1.1 date 2002.05.29.08.20.00; author skrll; state Exp; branches 1.1.2.1; next ; 1.1.2.1 date 2002.05.29.08.20.00; author jlam; state dead; branches; next 1.1.2.2; 1.1.2.2 date 2002.06.23.18.44.59; author jlam; state Exp; branches; next 1.1.2.3; 1.1.2.3 date 2002.08.22.11.10.59; author jlam; state dead; branches; next ; desc @@ 1.2 log @Remove devel/pth-syscall as it has been merged into devel/pth. @ text @$NetBSD: patch-ac,v 1.1 2002/05/29 08:20:00 skrll Exp $ --- pth_high.c.orig Sat Mar 24 14:49:58 2001 +++ pth_high.c @@@@ -141,8 +141,43 @@@@ return 0; } +#ifdef HAVE_SYS_RESOURCE_H +/* Pth variant of wait4(2) */ +pid_t pth_wait4(pid_t wpid, int *status, int options, struct rusage *rusage) +{ + pth_event_t ev; + static pth_key_t ev_key = PTH_KEY_INIT; + pid_t pid; + + pth_debug2("pth_wait4: called from thread \"%s\"", pth_current->name); + + for (;;) { + /* do a non-blocking poll for the pid */ + while ( (pid = pth_sc(wait4)(wpid, status, options|WNOHANG, rusage)) < 0 + && errno == EINTR) ; + + /* if pid was found or caller requested a polling return immediately */ + if (pid == -1 || pid > 0 || (pid == 0 && (options & WNOHANG))) + break; + + /* else wait a little bit */ + ev = pth_event(PTH_EVENT_TIME|PTH_MODE_STATIC, &ev_key, pth_timeout(0,250000)); + pth_wait(ev); + } + + pth_debug2("pth_wait4: leave to thread \"%s\"", pth_current->name); + return pid; +} + /* Pth variant of waitpid(2) */ -pid_t pth_waitpid(pid_t wpid, int *status, int options) +pid_t pth_waitpid(pid_t wpid, int *status, int options) +{ + return pth_wait4(wpid, status, options, 0); +} + +#else +/* Pth variant of wait4(2) */ +pid_t pth_waitpid(pid_t wpid, int *status, int options) { pth_event_t ev; static pth_key_t ev_key = PTH_KEY_INIT; @@@@ -167,6 +202,8 @@@@ pth_debug2("pth_waitpid: leave to thread \"%s\"", pth_current->name); return pid; } +#endif + /* Pth variant of system(3) */ int pth_system(const char *cmd) @ 1.1 log @Add a new variation on the pth package that has --enable-syscall-hard as part of the configure options. A pth with this option enabled provides some semblance of pre-emptive threads - enough for things like xmms and knode to actually work. Add the necessary glue to pthread.buildlink.mk and appropriate CONFLICT into pth. It is hoped that the pkgs that currently use -D_POSIX_THREAD_SYSCALL_SOFT=1 will be tested against pth-syscall and changed to use it. The goal is to be able to add --enable-syscall-hard to devel/pth and retire pth-syscall. Baby steps... @ text @d1 1 a1 1 $NetBSD$ @ 1.1.2.1 log @file patch-ac was added on branch buildlink2 on 2002-06-23 18:44:59 +0000 @ text @d1 58 @ 1.1.2.2 log @Merge from pkgsrc-current to buildlink2 branch. @ text @a0 58 $NetBSD: patch-ac,v 1.1.2.1 2002/06/23 18:44:59 jlam Exp $ --- pth_high.c.orig Sat Mar 24 14:49:58 2001 +++ pth_high.c @@@@ -141,8 +141,43 @@@@ return 0; } +#ifdef HAVE_SYS_RESOURCE_H +/* Pth variant of wait4(2) */ +pid_t pth_wait4(pid_t wpid, int *status, int options, struct rusage *rusage) +{ + pth_event_t ev; + static pth_key_t ev_key = PTH_KEY_INIT; + pid_t pid; + + pth_debug2("pth_wait4: called from thread \"%s\"", pth_current->name); + + for (;;) { + /* do a non-blocking poll for the pid */ + while ( (pid = pth_sc(wait4)(wpid, status, options|WNOHANG, rusage)) < 0 + && errno == EINTR) ; + + /* if pid was found or caller requested a polling return immediately */ + if (pid == -1 || pid > 0 || (pid == 0 && (options & WNOHANG))) + break; + + /* else wait a little bit */ + ev = pth_event(PTH_EVENT_TIME|PTH_MODE_STATIC, &ev_key, pth_timeout(0,250000)); + pth_wait(ev); + } + + pth_debug2("pth_wait4: leave to thread \"%s\"", pth_current->name); + return pid; +} + /* Pth variant of waitpid(2) */ -pid_t pth_waitpid(pid_t wpid, int *status, int options) +pid_t pth_waitpid(pid_t wpid, int *status, int options) +{ + return pth_wait4(wpid, status, options, 0); +} + +#else +/* Pth variant of wait4(2) */ +pid_t pth_waitpid(pid_t wpid, int *status, int options) { pth_event_t ev; static pth_key_t ev_key = PTH_KEY_INIT; @@@@ -167,6 +202,8 @@@@ pth_debug2("pth_waitpid: leave to thread \"%s\"", pth_current->name); return pid; } +#endif + /* Pth variant of system(3) */ int pth_system(const char *cmd) @ 1.1.2.3 log @Merge changes from pkgsrc-current into the buildlink2 branch for the packages that have buildlink2.mk files. @ text @d1 58 @