Lumiera  0.pre.03
»edit your freedom«
sync-classlock.hpp File Reference

Go to the source code of this file.

Description

A special implementation of lib::Sync, where the storage of the object monitor is associated directly to a type rather then to a single object instance.

While being problematic in conjunction with static startup/shutdown, doing so is sometimes necessary to setup type based dispatcher tables, managing singleton creation etc.

Note
simply using the ClassLock may cause a Monitor object (with a mutex) to be created at static initialisation and destroyed on application shutdown.
See also
depend.hpp usage example
SyncClasslock_test

Definition in file sync-classlock.hpp.

#include "lib/nobug-init.hpp"
#include "lib/zombie-check.hpp"
#include "lib/meta/util.hpp"
#include "lib/sync.hpp"

Classes

class  ClassLock< X, CONF >
 A synchronisation protection guard employing a lock scoped to the parameter type as a whole, not an individual instance. More...
 
struct  ClassLock< X, CONF >::PerClassMonitor
 

Namespaces

 lib
 Implementation namespace for support and library code.