diff options
author | rsc <devnull@localhost> | 2007-04-03 12:50:49 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2007-04-03 12:50:49 +0000 |
commit | 5cd829d5899a0b16b717ba65c57d1c2d7bd0f566 (patch) | |
tree | bf3eceecbe85368a4c43a5dea42d90cb53ab1d46 /src/cmd/page | |
parent | 41deef57ef8abbb64265cba6445f6bff5c99b455 (diff) | |
download | plan9port-5cd829d5899a0b16b717ba65c57d1c2d7bd0f566.tar.gz plan9port-5cd829d5899a0b16b717ba65c57d1c2d7bd0f566.tar.bz2 plan9port-5cd829d5899a0b16b717ba65c57d1c2d7bd0f566.zip |
finish conversion to libthread; avoids extra page proc sticking around (Tim Wiess)
Diffstat (limited to 'src/cmd/page')
-rw-r--r-- | src/cmd/page/page.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/cmd/page/page.c b/src/cmd/page/page.c index 52c6eee3..47a7f327 100644 --- a/src/cmd/page/page.c +++ b/src/cmd/page/page.c @@ -2,7 +2,6 @@ #include <libc.h> #include <draw.h> #include <thread.h> -#include <thread.h> #include <bio.h> #include <cursor.h> #include "page.h" @@ -33,6 +32,14 @@ watcher(void *v, char *x) return 0; } +void +watcherproc(void *v) +{ + threadnotify(watcher, 1); + for(;;) + sleep(1000); +} + int bell(void *u, char *x) { @@ -131,21 +138,14 @@ threadmain(int argc, char **argv) notegp = getpid(); - switch(notewatcher = fork()){ - case -1: - sysfatal("fork\n"); + notewatcher = proccreate(watcherproc, NULL, 1024); + if(notewatcher == -1){ + sysfatal("proccreate"); threadexitsall(0); - default: - break; - case 0: - atnotify(watcher, 1); - for(;;) - sleep(1000); - /* not reached */ } rfork(RFNOTEG); - atnotify(bell, 1); + threadnotify(bell, 1); readstdin = 0; if(imagemode == 0 && argc == 0){ |