Oracle Coherence for C++ API
Release 3.6.1.0

E18813-01

ConcurrentMap::LockBlock Class Reference

#include <coherence/util/ConcurrentMap.hpp>

List of all members.


Detailed Description

The LockBlock allows for easy creation of ConcurrentMap::lock code.

It's used on conjunction with the COH_CACHE_LOCK macros.


Public Member Functions

  LockBlock (ConcurrentMap::Handle hMap, Object::View vKey, bool fTryLock, int64_t cWait=-1L)
  Construct a LockBlock that will lock the supplied map.
  LockBlock (const LockBlock &that)
  Copy constructor used by the COH_CACHE_LOCK macros.
  ~LockBlock ()
  Destroy an LockBlock object, exiting the associated map.
  operator bool () const
  Boolean conversion for the COH_CACHE_LOCK macros.

Protected Attributes

ConcurrentMap::Handle  m_hMap
  Map to lock and unlock.
const Object::View  m_vKey
  Key to lock and unlock in the associated Map.
const bool  m_fTryLock
  Flag describing the type of lock being used.

Constructor & Destructor Documentation

LockBlock ( ConcurrentMap::Handle  hMap,
Object::View  vKey,
bool  fTryLock,
int64_t  cWait = -1L  
)

Construct a LockBlock that will lock the supplied map.

Parameters:
hMap  the map to lock
vKey  the Key to lock int he map
cWait  the number of milliseconds to continue trying to obtain a lock; pass zero to return immediately; pass -1 to block the calling thread until the lock could be obtained

Member Function Documentation

operator bool (  )  const

Boolean conversion for the COH_CACHE_LOCK macros.

Returns:
true if it's a time based lock and false if no

The documentation for this class was generated from the following file:
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.