Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
sync-classlock.hpp
Go to the documentation of this file.
1/*
2 SYNC-CLASSLOCK.hpp - special case of object based locking tied directly to a type
3
4 Copyright (C)
5 2008, Hermann Vosseler <Ichthyostega@web.de>
6 2023, Hermann Vosseler <Ichthyostega@web.de>
7
8  **Lumiera** is free software; you can redistribute it and/or modify it
9  under the terms of the GNU General Public License as published by the
10  Free Software Foundation; either version 2 of the License, or (at your
11  option) any later version. See the file COPYING for further details.
12
13*/
14
28#ifndef LIB_SYNC_CLASSLOCK_H
29#define LIB_SYNC_CLASSLOCK_H
30
31#include "lib/nobug-init.hpp"
32#include "lib/zombie-check.hpp"
33#include "lib/meta/util.hpp"
34#include "lib/sync.hpp"
35
36
37namespace lib {
38
39
54 template<class X, class CONF = RecursiveLock_NoWait>
56 : public Sync<CONF>::Lock
57 {
60
62
63 Monitor&
65 {
66 static PerClassMonitor classMonitor;
67 static ZombieCheck zombieCheck{util::typeStr(this)};
68
69 zombieCheck();
70 return classMonitor;
71 }
72
73 public:
77 };
78
79
80} // namespace lib
81#endif /*LIB_SYNC_CLASSLOCK_H*/
A synchronisation protection guard employing a lock scoped to the parameter type as a whole,...
Monitor & getPerClassMonitor()
scoped guard to control the actual locking.
Definition sync.hpp:228
Facility for monitor object based locking.
Definition sync.hpp:210
Automatic lifecycle tracker, to produce an alarm when accessing objects after deletion.
Object Monitor for synchronisation and waiting.
Definition sync.hpp:136
Simple and lightweight helpers for metaprogramming and type detection.
Implementation namespace for support and library code.
Trigger the basic NoBug initialisation by placing a static variable.
Object Monitor based synchronisation.
Detector to set off alarm when (re)using deceased objects.