diff options
author | Archie Cobbs <archie@FreeBSD.org> | 2001-03-16 01:20:02 +0000 |
---|---|---|
committer | Archie Cobbs <archie@FreeBSD.org> | 2001-03-16 01:20:02 +0000 |
commit | 4becd5a1b2f8b1e537171fefe6e90aa984a6e756 (patch) | |
tree | d04119f76fc18aebe858426a91f28844035f9a1e /java/java-tutorial | |
parent | Fixed bug imported by myself. (diff) |
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);
}
Notes
Notes:
svn path=/head/; revision=39905
Diffstat (limited to 'java/java-tutorial')
0 files changed, 0 insertions, 0 deletions