TIMEOUT question

Adam Lackorzynski adam at os.inf.tu-dresden.de
Wed Sep 12 23:25:41 CEST 2007


On Wed Sep 12, 2007 at 10:43:17 +0800, huang wrote:
>      I have a question about l4_ipc_sleep()! I want to make a stop between two
> ipc operation, so i used l4_ipc_sleep(), but it did not work!
>      The code is :
> 
> ...
> static void sleep(unsigned exp)
> {
> 	l4_ipc_sleep(l4_ipc_timeout(1,exp,1,exp));
> }
> ...
> 
> int main(int argc, char **argv)
> {
> ...
> 	for(;;)
> 	{
> 		...	
> 		sleep(4);
> 	}
> 
> 	return 0;
> }
> 
> I think sleep(4) should make a stop about 4 seconds, but the the call
> returned immediately. What's the problem in my code?

man==1 and exp==4 means  1*2^4 µs = 16µs

To sleep for about 4 seconds you could e.g. use man=976 and exp=12.

(Or l4_sleep().)



Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/




More information about the l4-hackers mailing list