Note that there are some explanatory texts on larger screens.

plurals
  1. POusing the boost::scoped_lock(Mutex &mx, bool initially_locked) constructor gives me errors
    primarykey
    data
    text
    <p>Isn't there a boost::scoped_lock constructor that takes a boolean as the second parameter? I thought I had used it before. boost::scoped_lock(Mutex &amp;mx, bool initially_locked)</p> <p>The <a href="http://www.boost.org/doc/libs/1_36_0/doc/html/boost/interprocess/scoped_lock.html#id2910396-bb" rel="nofollow noreferrer">documentation</a> for scoped_lock shows the second parameters as "<em>unspecified</em>". Anyone know what in the @(*$ that is suppose to mean?!?</p> <p>the errors I get are:</p> <pre><code>c:\program files\boost\boost_1_39\boost\thread\win32\basic_timed_mutex.hpp(118) : error C2679: binary '+' : no operator found which takes a right-hand operand of type 'const bool' (or there is no acceptable conversion) c:\program files\boost\boost_1_39\boost\date_time\posix_time\date_duration_operators.hpp(31): could be 'boost::posix_time::ptime boost::posix_time::operator +(const boost::posix_time::ptime &amp;,const boost::gregorian::months &amp;)' [found using argument-dependent lookup] c:\program files\boost\boost_1_39\boost\date_time\date_duration_types.hpp(132): or 'boost::gregorian::date boost::date_time::months_duration&lt;base_config&gt;::operator +(const boost::gregorian::date &amp;,const boost::date_time::months_duration&lt;base_config&gt; &amp;)' [found using argument-dependent lookup] with [ base_config=boost::gregorian::greg_durations_config ] c:\program files\boost\boost_1_39\boost\date_time\posix_time\date_duration_operators.hpp(75): or 'boost::posix_time::ptime boost::posix_time::operator +(const boost::posix_time::ptime &amp;,const boost::gregorian::years &amp;)' [found using argument-dependent lookup] c:\program files\boost\boost_1_39\boost\date_time\date_duration_types.hpp(244): or 'boost::gregorian::date boost::date_time::years_duration&lt;base_config&gt;::operator +(const boost::gregorian::date &amp;,const boost::date_time::years_duration&lt;base_config&gt; &amp;)' [found using argument-dependent lookup] with [ base_config=boost::gregorian::greg_durations_config ] c:\program files\boost\boost_1_39\boost\date_time\time.hpp(139): or 'boost::posix_time::ptime boost::date_time::base_time&lt;T,time_system&gt;::operator +(const boost::gregorian::date_duration &amp;) const' with [ T=boost::posix_time::ptime, time_system=boost::posix_time::posix_time_system ] c:\program files\boost\boost_1_39\boost\date_time\time.hpp(159): or 'boost::posix_time::ptime boost::date_time::base_time&lt;T,time_system&gt;::operator +(const boost::posix_time::time_duration &amp;) const' with [ T=boost::posix_time::ptime, time_system=boost::posix_time::posix_time_system ] while trying to match the argument list '(boost::system_time, const bool)' c:\program files\boost\boost_1_39\boost\thread\locks.hpp(353) : see reference to function template instantiation 'bool boost::detail::basic_timed_mutex::timed_lock&lt;TimeDuration&gt;(const Duration &amp;)' being compiled with [ TimeDuration=bool, Duration=bool ] c:\program files\boost\boost_1_39\boost\thread\locks.hpp(241) : see reference to function template instantiation 'bool boost::unique_lock&lt;Mutex&gt;::timed_lock&lt;TimeDuration&gt;(const TimeDuration &amp;)' being compiled with [ Mutex=boost::mutex, TimeDuration=bool ] d:\imagehawk\projects\virtualpc_archiveservice\ifl\src\archiveservice\archive.cpp(599) : see reference to function template instantiation 'boost::unique_lock&lt;Mutex&gt;::unique_lock&lt;bool&gt;(Mutex &amp;,const TimeDuration &amp;)' being compiled with [ Mutex=boost::mutex, TimeDuration=bool ] </code></pre> <p>Here's a bit of my source code if it helps:</p> <pre><code>void SpawnXMessageThread(bool bTakeLock=true) { boost::mutex::scoped_lock lock(m_mtx,bTakeLock); m_pxmessage= new XMessage(); m_pThread = new boost::thread(boost::ref(*m_pxmessage)); } </code></pre> <p>The idea is that I'll lock the m_mtx based on the boolean. This way if I lock m_mtx before calling SpawnXMessageThread I can tell SpawnXMessageThread not to lock the mutex (because I've aready locked it). </p> <p>btw, I'm kinda new to boost and threads.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload