| Date: Tue, 3 Apr 2007 12:50:49 +0000
finish conversion to libthread; avoids extra page proc sticking around (Tim Wiess)
Diffstat:
M src/cmd/page/page.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
--- |
| t@@ -2,7 +2,6 @@
#include
#include
#include
-#include
#include
#include
#include "page.h"
t@@ -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)
{
t@@ -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){ |