<!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>&gt; typedef class CriticalSection {</FONT>
<BR><FONT SIZE=2>&gt; [...]</FONT>
<BR><FONT SIZE=2>&gt; }CCriticalSection;</FONT>
</P>

<P><FONT SIZE=2>Out of curiosity, why typedef CCriticalSection to CriticalSection ?</FONT>
</P>

<P><FONT SIZE=2>&gt; Now in debug mode, initializer of &quot;CriticalSection&quot; is not being</FONT>
<BR><FONT SIZE=2>&gt; called. &amp; then locking fails. As soon as I change&nbsp; the name of class</FONT>
<BR><FONT SIZE=2>&gt; &quot;CriticalSection&quot; to some other name.. say &quot;ACriticalSection&quot;. code</FONT>
<BR><FONT SIZE=2>&gt; 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>