[LCP]FW: pthread_mutex_lock call hangs

Vincent Penquerc'h Vincent.Penquerch at artworks.co.uk
Wed Mar 12 18:13:02 UTC 2003


> typedef class CriticalSection {
> [...]
> }CCriticalSection;

Out of curiosity, why typedef CCriticalSection to CriticalSection ?

> Now in debug mode, initializer of "CriticalSection" is not being
> called. & then locking fails. As soon as I change  the name of class
> "CriticalSection" to some other name.. say "ACriticalSection". code
> works fine.

You said the only difference between debug and release was the
inclusion or ommision of -g, right ? Are you 100% sure about this ?
CriticalSection's ctor is inline and rather trivial, so will be
inlined if optimizations are enabled, so if you rely on breakpoints
to find out whether it's called or not, you'll miss it.

Anyway, I do suspect another difference than -g, because of the
behavior wrt renaming. Can you add -save-temps to your GCC command
(do not just run cpp or cpp0, run your normal GCC command, only with
-save-temps added). Do that for both builds. Compare the saved .ii
files. If -g is the only difference, they should be the same (modulo
some possible things introduced if you use things like __TIME__).

Just realized this was crossposted, so for other lists, sorry about
the HTML, my email leaves my mailer as plain text, nothing I can do
but nudge our sysop again :/

--
Vincent Penquerc'h 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/linuxcprogramming/attachments/20030312/854717b6/attachment.htm 


More information about the linuxCprogramming mailing list