aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/syncobj.h
diff options
context:
space:
mode:
authorAntonio Juarez <antonio.maria.juarez@live.com>2014-03-20 11:46:11 +0000
committerAntonio Juarez <antonio.maria.juarez@live.com>2014-03-20 11:46:11 +0000
commit8efa1313f3614f34ac0bac947314bb53e9a2412b (patch)
tree2752f8e6dfbb75bc53d56ea422482a8ec5870ffa /contrib/epee/include/syncobj.h
parentmoved all stuff to github (diff)
downloadmonero-8efa1313f3614f34ac0bac947314bb53e9a2412b.tar.xz
some fixes
Diffstat (limited to 'contrib/epee/include/syncobj.h')
-rw-r--r--contrib/epee/include/syncobj.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/epee/include/syncobj.h b/contrib/epee/include/syncobj.h
index ca7514ede..b7273da8e 100644
--- a/contrib/epee/include/syncobj.h
+++ b/contrib/epee/include/syncobj.h
@@ -41,27 +41,29 @@ namespace epee
struct simple_event
{
- simple_event()
+ simple_event() : m_rised(false)
{
- rised = false;
}
- std::mutex m_mx;
- std::condition_variable m_cond_var;
- bool rised;
- void rise()
+ void raise()
{
std::unique_lock<std::mutex> lock(m_mx);
- rised = true;
+ m_rised = true;
m_cond_var.notify_one();
}
void wait()
{
std::unique_lock<std::mutex> lock(m_mx);
- while (!rised)
+ while (!m_rised)
m_cond_var.wait(lock);
+ m_rised = false;
}
+
+ private:
+ std::mutex m_mx;
+ std::condition_variable m_cond_var;
+ bool m_rised;
};
class critical_region;