diff options
author | archie <archie@FreeBSD.org> | 2001-03-16 09:20:02 +0800 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 2001-03-16 09:20:02 +0800 |
commit | 9e4719c8ec6324598090474818a7fbd8d12d5d87 (patch) | |
tree | f19d535e6fb0a8494ae74154d6e53a1c903c5b7c /devel/pth | |
parent | b99436c245625ca5fa768a2ede419bf5220619b4 (diff) | |
download | freebsd-ports-gnome-9e4719c8ec6324598090474818a7fbd8d12d5d87.tar.gz freebsd-ports-gnome-9e4719c8ec6324598090474818a7fbd8d12d5d87.tar.zst freebsd-ports-gnome-9e4719c8ec6324598090474818a7fbd8d12d5d87.zip |
This patch fixes a scheduling bug and is to be incorporated in the
next version. In the meantime, apply with the port.
FYI, the bug is demonstrated by this program:
#include <stdio.h>
#include <stdlib.h>
#include <pth.h>
static int check_something(void *arg)
{
return (0);
}
static void *thread(void *arg)
{
printf("thread sleeping five seconds...\n");
pth_nap(pth_time(5, 0));
printf("thread is done sleeping\n"); /* bug: we never get here */
return (NULL);
}
int main(int ac, char **av)
{
pth_event_t ev;
pth_init();
pth_spawn(NULL, thread, NULL);
ev = pth_event(PTH_EVENT_FUNC, check_something, NULL, pth_time(2, 0));
while (1)
pth_wait(ev);
}
Diffstat (limited to 'devel/pth')
-rw-r--r-- | devel/pth/files/patch-aa | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/devel/pth/files/patch-aa b/devel/pth/files/patch-aa new file mode 100644 index 000000000000..53e5c233ccd8 --- /dev/null +++ b/devel/pth/files/patch-aa @@ -0,0 +1,14 @@ +--- pth_sched.c.broken Fri Mar 10 02:58:32 2000 ++++ pth_sched.c Fri Feb 16 20:21:57 2001 +@@ -763,8 +763,10 @@ + } + + /* perhaps we have to internally loop... */ +- if (loop_repeat) ++ if (loop_repeat) { ++ pth_time_set(now, PTH_TIME_NOW); + goto loop_entry; ++ } + + pth_debug1("pth_sched_eventmanager: leaving"); + return; |