Skip to content

Commit

Permalink
[plugins/MultiThreading] FIX problem at initialization of mTaskMutex.v_
Browse files Browse the repository at this point in the history
The plugin is broken since PR sofa-framework#549 as it removes the initialization
of the mutex. Possible explaination is that v_ is implementation
dependent but the existing initialization was done incorrectly
using a (int).

Now use BOOST_DETAIL_SPINLOCK_INIT which insure that the initialization
is coherent with the implementation used.

(I also cannot prevent myself to remove the two ugly commented lines)
  • Loading branch information
damienmarchal committed Jan 18, 2018
1 parent beb65f0 commit eebbd39
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions applications/plugins/MultiThreading/src/TaskSchedulerBoost.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
#include <boost/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
//#include <boost/detail/atomic_count.hpp>

//#include <boost/pool/singleton_pool.hpp>



namespace sofa
Expand Down Expand Up @@ -165,7 +161,7 @@ namespace sofa



mutable boost::detail::spinlock mTaskMutex;
mutable boost::detail::spinlock mTaskMutex {BOOST_DETAIL_SPINLOCK_INIT};
Task* mTask[Max_TasksPerThread];
unsigned mTaskCount;
Task::Status* mCurrentStatus;
Expand Down

0 comments on commit eebbd39

Please sign in to comment.