<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>RE: [LCP]FW: pthread_mutex_lock call hangs</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2>> typedef class CriticalSection {</FONT>
<BR><FONT SIZE=2>> [...]</FONT>
<BR><FONT SIZE=2>> }CCriticalSection;</FONT>
</P>
<P><FONT SIZE=2>Out of curiosity, why typedef CCriticalSection to CriticalSection ?</FONT>
</P>
<P><FONT SIZE=2>> Now in debug mode, initializer of "CriticalSection" is not being</FONT>
<BR><FONT SIZE=2>> called. & then locking fails. As soon as I change the name of class</FONT>
<BR><FONT SIZE=2>> "CriticalSection" to some other name.. say "ACriticalSection". code</FONT>
<BR><FONT SIZE=2>> works fine.</FONT>
</P>
<P><FONT SIZE=2>You said the only difference between debug and release was the</FONT>
<BR><FONT SIZE=2>inclusion or ommision of -g, right ? Are you 100% sure about this ?</FONT>
<BR><FONT SIZE=2>CriticalSection's ctor is inline and rather trivial, so will be</FONT>
<BR><FONT SIZE=2>inlined if optimizations are enabled, so if you rely on breakpoints</FONT>
<BR><FONT SIZE=2>to find out whether it's called or not, you'll miss it.</FONT>
</P>
<P><FONT SIZE=2>Anyway, I do suspect another difference than -g, because of the</FONT>
<BR><FONT SIZE=2>behavior wrt renaming. Can you add -save-temps to your GCC command</FONT>
<BR><FONT SIZE=2>(do not just run cpp or cpp0, run your normal GCC command, only with</FONT>
<BR><FONT SIZE=2>-save-temps added). Do that for both builds. Compare the saved .ii</FONT>
<BR><FONT SIZE=2>files. If -g is the only difference, they should be the same (modulo</FONT>
<BR><FONT SIZE=2>some possible things introduced if you use things like __TIME__).</FONT>
</P>
<P><FONT SIZE=2>Just realized this was crossposted, so for other lists, sorry about</FONT>
<BR><FONT SIZE=2>the HTML, my email leaves my mailer as plain text, nothing I can do</FONT>
<BR><FONT SIZE=2>but nudge our sysop again :/</FONT>
</P>
<P><FONT SIZE=2>--</FONT>
<BR><FONT SIZE=2>Vincent Penquerc'h </FONT>
</P>
</BODY>
</HTML>