use new thread library

This commit is contained in:
rsc 2004-12-26 23:24:32 +00:00
parent d9f3e89e5e
commit b20f06ab9c
6 changed files with 20 additions and 17 deletions

View file

@ -45,9 +45,7 @@ _ioproc(void *arg)
fd = XConnectionNumber(_x.kbdcon);
XSelectInput(_x.kbdcon, _x.drawable, KeyPressMask);
for(;;){
while(XCheckWindowEvent(_x.kbdcon, _x.drawable, KeyPressMask, &xevent) == False){
threadfdwait(fd, 'r');
}
XWindowEvent(_x.kbdcon, _x.drawable, KeyPressMask, &xevent);
switch(xevent.type){
case KeyPress:
i = _xtoplan9kbd(&xevent);
@ -69,12 +67,12 @@ initkeyboard(char *file)
{
Keyboardctl *kc;
threadfdwaitsetup();
kc = mallocz(sizeof(Keyboardctl), 1);
if(kc == nil)
return nil;
kc->c = chancreate(sizeof(Rune), 20);
threadcreate(_ioproc, kc, 32768);
chansetname(kc->c, "kbdc");
proccreate(_ioproc, kc, 32768);
return kc;
}