&nbsp;g++ boo_t.cpp&nbsp; -L../resource/boost_1_35_0/bin.v2/libs/thread/build/gcc-4.1.2/release/threading-multi/libboost_thread-gcc41-mt-1_35.so.1.35.0 -Lpthread<br />
boo_t.cpp: In function &lsquo;void increment_count()&rsquo;:<br />
boo_t.cpp:14: error: reference to &lsquo;mutex&rsquo; is ambiguous<br />
boo_t.cpp:10: error: candidates are: boost::mutex mutex<br />
/usr/include/boost/thread/mutex.hpp:35: error:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class boost::mutex<br />
<br />
code: <br />
#include &lt;boost/thread.hpp&gt;<br />
#include &lt;boost/thread/mutex.hpp&gt;<br />
#include &lt;iostream&gt;<br />
<br />
using namespace std;<br />
using namespace boost;<br />
<br />
int count = 0;<br />
boost::mutex mutex;<br />
<br />
void increment_count()<br />
{<br />
&nbsp;&nbsp; boost::mutex::scoped_lock lock(mutex);<br />
&nbsp;&nbsp; std::cout &lt;&lt; &quot;count = &quot; &lt;&lt; ++count &lt;&lt; std::endl;<br />
}<br />
<br />
int main(int argc, char* argv[])<br />
{<br />
&nbsp;&nbsp; boost::thread_group threads;<br />
&nbsp;&nbsp; for (int i = 0; i &lt; 10; ++i)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; threads.create_thread(&amp;increment_count);<br />
&nbsp;&nbsp; threads.join_all();<br />
&quot;boo_t.cpp&quot; 24L, 480C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1,1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Top<br />
<br />
c<hr style="border:dotted 1px silver; width:90%; border:dotted 1px silver;">Peisheng Wang<br />
Software Engineer<br />
iZENEsoft (Shanghai) Co., Ltd<br />
Room 601 Marine Tower, No. 1 Pudong Ave.<br />
Tel:86-21-68860698-114<br />
Fax:86-21-68860699<br />
Company Website:<a target="_blank" href="http://www.izenesoft.com/">www.izenesoft.com</a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<a href="../../../../index.php?menuaction=felamimail.uicompose.compose&amp;send_to=Wmhlbi5ZdUBNb3JnYW5TdGFubGV5LmNvbQ=="><font color="blue">Zhen.Yu@MorganStanley.com</font></a>