If you can read this text, it means you are not experiencing this website at its best. This website is designed for used with a standards-compliant browser.
Current version: 2.3.2
ZThreads
A platform-independent, multi-threading and synchronization library for C++
Home Documentation Downloads CVS Contact
LockedScope Class Reference

#include <Guard.h>

Static Public Member Functions

template<class LockType >
static bool createScope (LockHolder< LockType > &l, unsigned long ms)
 
template<class LockType >
static void createScope (LockHolder< LockType > &l)
 
template<class LockType >
static void destroyScope (LockHolder< LockType > &l)
 

Detailed Description

Author
Eric Crahen http://www.code-foo.com
Date
<2003-07-16T17:55:42-0400>
Version
2.2.0

Locking policy for Lockable objects. This policy acquire()s a Lockable when the protection scope is created, and it release()s a Lockable when the scope is destroyed.

Member Function Documentation

◆ createScope() [1/2]

static void createScope ( LockHolder< LockType > &  l)
inlinestatic

A new protection scope is being created.

Parameters
lockLockType& is a type of LockHolder.

◆ createScope() [2/2]

static bool createScope ( LockHolder< LockType > &  l,
unsigned long  ms 
)
inlinestatic

A new protection scope is being created by l2, using an existing scope created by l1.

Parameters
lock1LockType1& is the LockHolder that holds the desired lock
lock2LockType1& is the LockHolder that wants to share template <class LockType1, class LockType2> static void shareScope(LockHolder<LockType1>& l1, LockHolder<LockType2>& l2) {

l2.getLock().acquire();

} A new protection scope is being created.

Parameters
lockLockType& is a type of LockHolder.

◆ destroyScope()

static void destroyScope ( LockHolder< LockType > &  l)
inlinestatic

A protection scope is being destroyed.

Parameters
lockLockType& is a type of LockHolder.

The documentation for this class was generated from the following file: