]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/plr/server/src/locking.h
update
[l4.git] / l4 / pkg / plr / server / src / locking.h
1 // vi: ft=cpp
2 /*
3  * locking.h --
4  *
5  *     Global locking stuff
6  *
7  * (c) 2011-2013 Björn Döbel <doebel@os.inf.tu-dresden.de>,
8  *     economic rights: Technische Universität Dresden (Germany)
9  * This file is part of TUD:OS and distributed under the terms of the
10  * GNU General Public License 2.
11  * Please see the COPYING-GPL-2 file for details.
12  */
13
14 #pragma once
15 #include "memory"
16 #include "log"
17
18 namespace Romain {
19 struct Rm_guard
20 {
21         Romain::Region_map *map;
22         Rm_guard(Romain::Region_map *m, unsigned id)
23                 : map(m)
24         {
25                 map->activate(id); }
26
27         ~Rm_guard()
28         {
29                 map->release();
30         }
31 };
32 }