* class gives reasonable results even
* when used with several threads.
*/
- Threads::ThreadMutex mutex;
+ Threads::Mutex mutex;
};
* A variable to guard access to
* the fe_values variable.
*/
- mutable Threads::ThreadMutex fe_values_mutex;
+ mutable Threads::Mutex fe_values_mutex;
/**
* Compute the positions of the
* when used with several
* threads.
*/
- mutable Threads::ThreadMutex mutex;
+ mutable Threads::Mutex mutex;
/**
* A helper function that clears the
return;
// make this function thread safe
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ Threads::Mutex::ScopedLock lock (mutex);
const unsigned int n_import_targets = part.import_targets().size();
const unsigned int n_ghost_targets = part.ghost_targets().size();
return;
// make this function thread safe
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ Threads::Mutex::ScopedLock lock (mutex);
const unsigned int n_import_targets = part.import_targets().size();
const unsigned int n_ghost_targets = part.ghost_targets().size();
return;
// make this function thread safe
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ Threads::Mutex::ScopedLock lock (mutex);
const unsigned int n_import_targets = part.import_targets().size();
const unsigned int n_ghost_targets = part.ghost_targets().size();
if (update_ghost_values_requests.size() > 0)
{
// make this function thread safe
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ Threads::Mutex::ScopedLock lock (mutex);
int ierr;
ierr = MPI_Waitall (update_ghost_values_requests.size(),
* this class for more
* information.
*/
- Threads::ThreadMutex &get_synchronisation_lock () const;
+ Threads::Mutex &get_synchronisation_lock () const;
/** @addtogroup Exceptions
* @{ */
* Mutexes for synchronising access
* to this class.
*/
- static Threads::ThreadMutex static_synchronisation_lock;
- mutable Threads::ThreadMutex non_static_synchronisation_lock;
+ static Threads::Mutex static_synchronisation_lock;
+ mutable Threads::Mutex non_static_synchronisation_lock;
/**
* Fill the <tt>A</tt> array from the
* this class for more
* information.
*/
- Threads::ThreadMutex &get_synchronisation_lock () const;
+ Threads::Mutex &get_synchronisation_lock () const;
/** @addtogroup Exceptions
* @{ */
* Mutex for synchronising access
* to this class.
*/
- static Threads::ThreadMutex synchronisation_lock;
+ static Threads::Mutex synchronisation_lock;
/**
* Fill the <tt>A</tt> array from the
* we can as well get away
* with it.
*/
- Threads::ThreadMutex lock;
+ Threads::Mutex lock;
/**
* Flag by which the @p alert
// if in MT mode, block all other
// operations. if not in MT mode,
// this is a no-op
- Threads::ThreadMutex::ScopedLock lock(this->lock);
+ Threads::Mutex::ScopedLock lock(this->lock);
Vector<number>::operator = (v);
data_is_preloaded = false;
// if in MT mode, block all other
// operations. if not in MT mode,
// this is a no-op
- Threads::ThreadMutex::ScopedLock lock(this->lock);
+ Threads::Mutex::ScopedLock lock(this->lock);
// check that we have not called
// @p alert without the respective
// (there should be none, but who
// knows). if not in MT mode,
// this is a no-op
- Threads::ThreadMutex::ScopedLock lock(this->lock);
+ Threads::Mutex::ScopedLock lock(this->lock);
// this is too bad: someone
// requested the vector in advance,
* internal data of this object
* from multiple threads.
*/
- static Threads::ThreadMutex mutex;
+ static Threads::Mutex mutex;
};
/*@}*/
// since it should happen rather rarely that there are
// several threads operating on different intergrid
// weights, have only one mutex for all of them
- static Threads::ThreadMutex mutex;
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ static Threads::Mutex mutex;
+ Threads::Mutex::ScopedLock lock (mutex);
for (unsigned int i=0; i<global_parameter_representation.size(); ++i)
// set this weight if it belongs to a parameter dof.
if (weight_mapping[i] != -1)
// linking libraries for more than
// one space dimension together
static
- Threads::ThreadMutex fe_name_map_lock;
+ Threads::Mutex fe_name_map_lock;
// This is the map used by
// FETools::get_fe_from_name and
// operation of this function;
// for this, acquire the lock
// until we quit this function
- Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
+ Threads::Mutex::ScopedLock lock(fe_name_map_lock);
Assert(fe_name_map_1d.find(name) == fe_name_map_1d.end(),
ExcMessage("Cannot change existing element in finite element name list"));
// operation of this function;
// for this, acquire the lock
// until we quit this function
- Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
+ Threads::Mutex::ScopedLock lock(fe_name_map_lock);
Assert(fe_name_map_2d.find(name) == fe_name_map_2d.end(),
ExcMessage("Cannot change existing element in finite element name list"));
// operation of this function;
// for this, acquire the lock
// until we quit this function
- Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
+ Threads::Mutex::ScopedLock lock(fe_name_map_lock);
Assert(fe_name_map_3d.find(name) == fe_name_map_3d.end(),
ExcMessage("Cannot change existing element in finite element name list"));
{
// Make sure no other thread
// is just adding an element
- Threads::ThreadMutex::ScopedLock lock (fe_name_map_lock);
+ Threads::Mutex::ScopedLock lock (fe_name_map_lock);
AssertThrow (fe_name_map.find(name_part) != fe_name_map.end(),
ExcInvalidFEName(name));
// fe_values variable isn't used
// simulatenously from different
// threads
- Threads::ThreadMutex::ScopedLock lock(fe_values_mutex);
+ Threads::Mutex::ScopedLock lock(fe_values_mutex);
fe_values.reinit(dof_cell);
fe_values.get_function_values(*euler_vector, shift_vector);
/* -------------------------- MA27 ---------------------------- */
-Threads::ThreadMutex SparseDirectMA27::static_synchronisation_lock;
+Threads::Mutex SparseDirectMA27::static_synchronisation_lock;
struct SparseDirectMA27::DetachedModeData
* thread is currently talking
* through the pipe.
*/
- Threads::ThreadMutex mutex;
+ Threads::Mutex mutex;
/**
* File handles for the pipe
if (detached_mode_data != 0)
{
// close down client
- Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+ Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
// Assign the result of write
// and reset the variable to
// avoid compiler warnings
-Threads::ThreadMutex &
+Threads::Mutex &
SparseDirectMA27::get_synchronisation_lock () const
{
if (detached_mode)
IKEEP, IW1, NSTEPS, IFLAG);
else
{
- Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+ Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
// first write the data we have
// to push over, i.e. first
// function index, then array
// basically, everything is
// already over the line,
// except for A and LA
- Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+ Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
detached_mode_data->put ("2", 1, "ACTION 2");
detached_mode_data->put (LA, 1, "LA");
HSL::MA27::ma27x1_ (NRLNEC);
else
{
- Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+ Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
// ma27x1 only reads data, so
// don't send anything except
// for the id
HSL::MA27::ma27x2_ (NIRNEC);
else
{
- Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+ Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
// ma27x2 only reads data, so
// don't send anything except
// for the id
HSL::MA27::ma27x3_ (LP);
else
{
- Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex);
+ Threads::Mutex::ScopedLock lock (detached_mode_data->mutex);
// ma27x2 only reads data, so
// don't send anything except
// for the id
/* -------------------------- MA47 ---------------------------- */
-Threads::ThreadMutex SparseDirectMA47::synchronisation_lock;
+Threads::Mutex SparseDirectMA47::synchronisation_lock;
SparseDirectMA47::SparseDirectMA47 (const double LIW_factor_1,
-Threads::ThreadMutex &
+Threads::Mutex &
SparseDirectMA47::get_synchronisation_lock () const
{
return synchronisation_lock;
typename GrowingVectorMemory<VECTOR>::Pool GrowingVectorMemory<VECTOR>::pool;
template <typename VECTOR>
-Threads::ThreadMutex GrowingVectorMemory<VECTOR>::mutex;
+Threads::Mutex GrowingVectorMemory<VECTOR>::mutex;
template <typename VECTOR>
inline
current_alloc(0),
log_statistics(log_statistics)
{
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ Threads::Mutex::ScopedLock lock(mutex);
pool.initialize(initial_size);
}
VECTOR *
GrowingVectorMemory<VECTOR>::alloc ()
{
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ Threads::Mutex::ScopedLock lock(mutex);
++total_alloc;
++current_alloc;
// see if there is a free vector
void
GrowingVectorMemory<VECTOR>::free(const VECTOR *const v)
{
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ Threads::Mutex::ScopedLock lock(mutex);
for (typename std::vector<entry_type>::iterator i=pool.data->begin();
i != pool.data->end(); ++i)
{
void
GrowingVectorMemory<VECTOR>::release_unused_memory ()
{
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ Threads::Mutex::ScopedLock lock(mutex);
std::vector<entry_type> new_data;
std::size_t
GrowingVectorMemory<VECTOR>::memory_consumption () const
{
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ Threads::Mutex::ScopedLock lock(mutex);
std::size_t result = sizeof (*this);
const typename std::vector<entry_type>::const_iterator
const Function<spacedim> *const coefficient,
const std::vector<unsigned int> &component_mapping,
const MatrixCreator::internal::IteratorRange<DoFHandler<dim,spacedim> > range,
- Threads::ThreadMutex &mutex)
+ Threads::Mutex &mutex)
{
// All assertions for this function
// are in the calling function
dofs_on_face_vector.end());
// lock the matrix
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ Threads::Mutex::ScopedLock lock (mutex);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
if (dof_is_on_face[i] && dof_to_boundary_mapping[dofs[i]] != numbers::invalid_unsigned_int)
const Function<3> *const ,
const std::vector<unsigned int> &,
const MatrixCreator::internal::IteratorRange<DoFHandler<2,3> > ,
- Threads::ThreadMutex &)
+ Threads::Mutex &)
{
Assert(false,ExcNotImplemented());
}
const Function<3> *const ,
const std::vector<unsigned int> &,
const MatrixCreator::internal::IteratorRange<DoFHandler<1,3> > ,
- Threads::ThreadMutex &)
+ Threads::Mutex &)
{
Assert(false,ExcNotImplemented());
}
// mutex to synchronise access to
// the matrix
- Threads::ThreadMutex mutex;
+ Threads::Mutex mutex;
typedef std_cxx1x::tuple<const Mapping<dim,spacedim> &,
const DoFHandler<dim,spacedim> &,
const Function<spacedim> *const coefficient,
const std::vector<unsigned int> &component_mapping,
const MatrixCreator::internal::IteratorRange<DoFHandler<dim,spacedim> > range,
- Threads::ThreadMutex &mutex);
+ Threads::Mutex &mutex);
create_boundary_mass_matrix_1_t p
= &create_boundary_mass_matrix_1<dim,spacedim>;
const Function<spacedim> *const coefficient,
const std::vector<unsigned int> &component_mapping,
const MatrixCreator::internal::IteratorRange<hp::DoFHandler<dim,spacedim> > range,
- Threads::ThreadMutex &mutex)
+ Threads::Mutex &mutex)
{
const hp::MappingCollection<dim,spacedim> &mapping = std_cxx1x::get<0>(commons);
const hp::DoFHandler<dim,spacedim> &dof = std_cxx1x::get<1>(commons);
#endif
// lock the matrix
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ Threads::Mutex::ScopedLock lock (mutex);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
if (dof_is_on_face[i] && dof_is_on_face[j])
// mutex to synchronise access to
// the matrix
- Threads::ThreadMutex mutex;
+ Threads::Mutex mutex;
// then assemble in parallel
typedef void (*create_boundary_mass_matrix_1_t)
const Function<spacedim> *const coefficient,
const std::vector<unsigned int> &component_mapping,
const MatrixCreator::internal::IteratorRange<hp::DoFHandler<dim,spacedim> > range,
- Threads::ThreadMutex &mutex);
+ Threads::Mutex &mutex);
create_boundary_mass_matrix_1_t p = &create_boundary_mass_matrix_1<dim,spacedim>;
//TODO: Use WorkStream here