Hello Fans!

Still need help with Rendez...
I can use lock, qlock and rendezvous without any problem but Rendez
don't work... if rsleep executed earlier than rwakeup, abort() cause
exception, stk() show:
rsleep ... /sys/src/libc/9sys/qlock.c:286
This line contain me = getqlp() in getqlp i find abort()...

in other way when rwakeup executed first, abort() ... stk() show:
rwakeup ... /sys/src/libc/9sys/qlock.c:329
which point me to another abort()

Maybe it wrong initialization? But I also try other way... or I wrong
use rendez?

#include <u.h>
#include <libc.h>

QLock q={0};
Rendez r={.l=&q};

void testthread(void)
{
        switch(rfork(RFPROC|RFMEM))
        {
                case -1:
                        print("can't fork");
                        exits(0);
                case 0:
                        break;
                default:
                        return;
        }
        
        for(;;)
        {
                print("Sleep\n");
                rsleep(&r);
                print("Wake up!\n");
        }
        
        exits(0);
}

void main(int,char**)
{
        int x;
        
        testthread();
        
        for (x=0;x<10;)
        {
                if (rwakeup(&r))
                        x++;
        }
        exits(0);
}

Thanks for help!

-- 
http://rs-rlab.narod.ru                            mailto:[EMAIL PROTECTED]

Reply via email to