mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
Lock guard for MxTasking.
This commit is contained in:
15
repos/ealanos/src/lib/mx/synchronization/lock_guard.h
Normal file
15
repos/ealanos/src/lib/mx/synchronization/lock_guard.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace mx::synchronization {
|
||||||
|
template <class LOCK> class Lock_guard
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
LOCK &_lock;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
Lock_guard(LOCK lock) : _lock(lock) { _lock.lock(); }
|
||||||
|
~Lock_guard() { _lock.unlock(); }
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user