* colon and there is a double
* colon after the last prefix.
*/
- void push (const std::string &text) DEAL_II_DEPRECATED;
+ void push (const std::string &text);
/**
* @deprecated Use Prefix instead
*
* Remove the last prefix.
*/
- void pop () DEAL_II_DEPRECATED;
+ void pop ();
/**
* Maximum number of levels to be
* <tt>operator *=</tt> and
* <tt>operator /=</tt> instead.
*/
- void scale (const Number factor) DEAL_II_DEPRECATED;
+ void scale (const Number factor) DEAL_II_DEPRECATED
+ {
+ this->operator *= (factor);
+ }
/**
-template <typename Number>
-inline
-Vector<Number> &Vector<Number>::operator *= (const Number factor)
-{
-
- Assert (numbers::is_finite(factor),ExcNumberNotFinite());
-
- scale (factor);
- return *this;
-}
-
-
-
template <typename Number>
inline
Vector<Number> &
template <typename Number>
void
-Vector<Number>::scale (const Number factor)
+Vector<Number> &Vector<Number>::operator *= (const Number factor)
{
Assert (numbers::is_finite(factor),ExcNumberNotFinite());
val,
(factor*boost::lambda::_1),
internal::Vector::minimum_parallel_grain_size);
+
+ return *this;
}
result.add(-8., aux);
f.vector_value(p+incr[0], aux);
result.add(8., aux);
- result.scale(1./(12*h));
+ result/=(12.*h);
return;
default:
Assert(false, ExcInvalidFormula());
namespace
{
- Threads::ThreadMutex log_lock;
- Threads::ThreadMutex write_lock;
+ Threads::Mutex log_lock;
+ Threads::Mutex write_lock;
}
void
LogStream::test_mode(bool on)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
if (on)
{
double_threshold = 1.e-10;
std::ostream & (* const p_endl) (std::ostream &) = &std::endl;
if (p == p_endl)
{
- Threads::ThreadMutex::ScopedLock lock(write_lock);
+ Threads::Mutex::ScopedLock lock(write_lock);
print_line_head();
std::ostringstream &stream = get_stream();
if (prefixes.size() <= std_depth)
LogStream::get_stream()
{
//TODO: use a ThreadLocalStorage object here
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
const unsigned int id = Threads::this_thread_id();
// if necessary allocate a stream object
void
LogStream::attach(std::ostream &o)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
file = &o;
o.setf(std::ios::showpoint | std::ios::left);
o << dealjobid();
void LogStream::detach ()
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
file = 0;
}
void LogStream::log_cerr ()
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
if (old_cerr == 0)
{
old_cerr = std::cerr.rdbuf(file->rdbuf());
void
LogStream::push (const std::string &text)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
std::string pre=prefixes.top();
pre += text;
pre += std::string(":");
void LogStream::pop ()
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
if (prefixes.size() > 1)
prefixes.pop();
}
unsigned int
LogStream::depth_console (const unsigned int n)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
const unsigned int h = std_depth;
std_depth = n;
return h;
unsigned int
LogStream::depth_file (const unsigned int n)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
const unsigned int h = file_depth;
file_depth = n;
return h;
void
LogStream::threshold_double (const double t)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
double_threshold = t;
}
void
LogStream::threshold_float (const float t)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
float_threshold = t;
}
bool
LogStream::log_execution_time (const bool flag)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
const bool h = print_utime;
print_utime = flag;
return h;
bool
LogStream::log_time_differences (const bool flag)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
const bool h = diff_utime;
diff_utime = flag;
return h;
bool
LogStream::log_thread_id (const bool flag)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
const bool h = print_thread_id;
print_thread_id = flag;
return h;
// more fine-grained solution
namespace
{
- Threads::ThreadMutex coefficients_lock;
+ Threads::Mutex coefficients_lock;
}
// operation of this function;
// for this, acquire the lock
// until we quit this function
- Threads::ThreadMutex::ScopedLock lock(coefficients_lock);
+ Threads::Mutex::ScopedLock lock(coefficients_lock);
// The first 2 coefficients are hard-coded
if (k==0)
// then get a pointer to the array
// of coefficients. do that in a MT
// safe way
- Threads::ThreadMutex::ScopedLock lock (coefficients_lock);
+ Threads::Mutex::ScopedLock lock (coefficients_lock);
return *shifted_coefficients[k];
}
// of this function
// for this, acquire the lock
// until we quit this function
- Threads::ThreadMutex::ScopedLock lock(coefficients_lock);
+ Threads::Mutex::ScopedLock lock(coefficients_lock);
// The first 2 coefficients
// are hard-coded
// then get a pointer to the array
// of coefficients. do that in a MT
// safe way
- Threads::ThreadMutex::ScopedLock lock (coefficients_lock);
+ Threads::Mutex::ScopedLock lock (coefficients_lock);
return *recursive_coefficients[k];
}
// deal.II/create_mass_matrix_05)
// will start to produce random
// results in multithread mode
- static Threads::ThreadMutex mutex;
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ static Threads::Mutex mutex;
+ Threads::Mutex::ScopedLock lock(mutex);
static std::vector<double> p_values;
static std::vector<Tensor<1,dim> > p_grads;
// operates on a per-object base (in which case we would have to
// include the huge <thread_management.h> file into the
// <subscriptor.h> file).
- Threads::ThreadMutex subscription_lock;
+ Threads::Mutex subscription_lock;
}
#ifdef DEBUG
if (object_info == 0)
object_info = &typeid(*this);
- Threads::ThreadMutex::ScopedLock lock (subscription_lock);
+ Threads::Mutex::ScopedLock lock (subscription_lock);
++counter;
#ifndef DEAL_II_USE_MT
if (counter == 0)
return;
- Threads::ThreadMutex::ScopedLock lock (subscription_lock);
+ Threads::Mutex::ScopedLock lock (subscription_lock);
--counter;
#ifndef DEAL_II_USE_MT
// counter and access mutex for the
// number of threads
volatile unsigned int n_existing_threads_counter = 1;
- ThreadMutex n_existing_threads_mutex;
+ Mutex n_existing_threads_mutex;
void register_thread ()
{
- ThreadMutex::ScopedLock lock (n_existing_threads_mutex);
+ Mutex::ScopedLock lock (n_existing_threads_mutex);
++n_existing_threads_counter;
}
void deregister_thread ()
{
- ThreadMutex::ScopedLock lock (n_existing_threads_mutex);
+ Mutex::ScopedLock lock (n_existing_threads_mutex);
--n_existing_threads_counter;
Assert (n_existing_threads_counter >= 1,
ExcInternalError());
unsigned int n_existing_threads ()
{
- ThreadMutex::ScopedLock lock (internal::n_existing_threads_mutex);
+ Mutex::ScopedLock lock (internal::n_existing_threads_mutex);
return internal::n_existing_threads_counter;
}
void
TimerOutput::enter_subsection (const std::string §ion_name)
{
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ Threads::Mutex::ScopedLock lock (mutex);
Assert (section_name.empty() == false,
ExcMessage ("Section string is empty."));
Assert (!active_sections.empty(),
ExcMessage("Cannot exit any section because none has been entered!"));
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ Threads::Mutex::ScopedLock lock (mutex);
if (section_name != "")
{