This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: POSIX Semaphore under gdb


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.zuidam@computer.org




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]