-/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
XBT_PUBLIC_CLASS ConditionVariable
{
private:
- friend s_smx_cond;
+ friend s_smx_cond_t;
smx_cond_t cond_;
explicit ConditionVariable(smx_cond_t cond) : cond_(cond) {}
public:
void wait(std::unique_lock<Mutex> & lock);
template <class P> void wait(std::unique_lock<Mutex> & lock, P pred)
{
- while (!pred())
+ while (not pred())
wait(lock);
}
std::cv_status wait_for(std::unique_lock<Mutex> & lock, double duration);
template <class P> bool wait_until(std::unique_lock<Mutex> & lock, double timeout_time, P pred)
{
- while (!pred())
+ while (not pred())
if (this->wait_until(lock, timeout_time) == std::cv_status::timeout)
return pred();
return true;
void notify_one();
void notify_all();
-
- XBT_ATTRIB_DEPRECATED("Use notify_one() instead")
- void notify() { notify_one(); }
};
using ConditionVariablePtr = ConditionVariable::Ptr;