List Info

Thread: Re: POSIX Semaphore under gdb




Re: POSIX Semaphore under gdb
country flaguser name
Netherlands
2007-04-16 16:20:02
Hi,

It is not a gdb problem, but a Ddd problem.  When you hover
over a  
variable, Ddd interrupts the application to retrieve it's
value and  
then continues it.  If the application (or a thread) was
blocked in a  
sem_wait() it will return -1 and set errno to EINTR.

There are two solutions:

	1. Keep the mouse pointer out of the source window.
	2. Replace all sem_wait()s with something like:
		while (sem_wait(...) < 0)
			if (errno != EINTR)
				break;
	   No ideal, but workable.

This also holds for all other system calls that can be
interrupted,  
but it usually only matters for semaphores.

Regards,
Hans
--
Hans Zuidam
De Koppele 136, 5632 LD Eindhoven, The Netherlands
Tel. +31 40 2481546, Mob. +31 6 42345456
h.zuidamcomputer.org




[1]

about | contact  Other archives ( Real Estate discussion Medical topics )