MADARA  3.1.8
ContextGuard.cpp
Go to the documentation of this file.
1 #include "ContextGuard.h"
2 
5  : context_ (knowledge.get_context ())
6 {
7  context_.lock ();
8 }
9 
11  ThreadSafeContext & context)
12  : context_ (context)
13 {
14  context_.lock ();
15 }
16 
18 {
19  context_.unlock ();
20 }
void lock(void) const
Locks the mutex on this context.
This class stores variables and their values for use by any entity needing state information in a thr...
ContextGuard(KnowledgeBase &knowledge)
Constructor.
Definition: ContextGuard.cpp:3
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:44
void unlock(void) const
Unlocks the mutex on this context.
Provides functions and classes for the distributed knowledge base.
ThreadSafeContext & context_
The context that will be locked.
Definition: ContextGuard.h:46