RTBKit  0.9
Open-source framework to create real-time ad bidding systems.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes
Datacratic::GcLockBase Struct Reference
Inheritance diagram for Datacratic::GcLockBase:
Datacratic::GcLock Datacratic::SharedGcLock SharedGcLockProxy

List of all members.

Classes

struct  Data
struct  Deferred
struct  DeferredList
 Data about each epoch. More...
struct  ExclusiveGuard
struct  SharedGuard
struct  ThreadGcInfoEntry
 A thread's bookkeeping info about each GC area. More...

Public Types

typedef
ML::ThreadSpecificInstanceInfo
< ThreadGcInfoEntry,
GcLockBase
GcInfo
typedef GcInfo::PerThreadInfo ThreadGcInfo
typedef void( WorkFn1 )(void *)
typedef void( WorkFn2 )(void *, void *)
typedef void( WorkFn3 )(void *, void *, void *)

Public Member Functions

struct Datacratic::GcLockBase::Data JML_ALIGNED (16)
bool updateData (Data &oldValue, Data &newValue)
void runDefers ()
std::vector< DeferredList * > checkDefers ()
void enterCS (ThreadGcInfoEntry *entry=0)
void exitCS (ThreadGcInfoEntry *entry=0)
void enterCSExclusive (ThreadGcInfoEntry *entry=0)
void exitCSExclusive (ThreadGcInfoEntry *entry=0)
int myEpoch (GcInfo::PerThreadInfo *threadInfo=0) const
int currentEpoch () const
JML_ALWAYS_INLINE
ThreadGcInfoEntry
getEntry (GcInfo::PerThreadInfo *info=0) const
virtual void unlink ()=0
void lockShared (GcInfo::PerThreadInfo *info=0)
void unlockShared (GcInfo::PerThreadInfo *info=0)
int isLockedShared (GcInfo::PerThreadInfo *info=0) const
int lockedInEpoch (GcInfo::PerThreadInfo *info=0) const
void lockExclusive (GcInfo::PerThreadInfo *info=0)
void unlockExclusive (GcInfo::PerThreadInfo *info=0)
int isLockedExclusive (GcInfo::PerThreadInfo *info=0) const
void visibleBarrier ()
void deferBarrier ()
void defer (boost::function< void()> work)
void defer (void(work)(void *), void *arg)
void defer (void(work)(void *, void *), void *arg1, void *arg2)
void defer (void(work)(void *, void *, void *), void *arg1, void *arg2, void *arg3)
template<typename T >
void defer (void(*work)(T *), T *arg)
template<typename T >
void deferDelete (T *toDelete)
template<typename... Args>
void doDefer (void(fn)(Args...), Args...)
template<typename Fn , typename... Args>
void deferBind (Fn fn, Args...args)
void dump ()

Static Public Member Functions

template<typename T >
static void doDelete (T *arg)

Public Attributes

GcInfo gcInfo
Datadata
Deferreddeferred
 Deferred workloads (hidden structure)
struct
Datacratic::GcLockBase::SharedGuard 
JML_ALIGNED

Detailed Description

Definition at line 31 of file gc_lock.h.


Member Function Documentation

Check what deferred updates need to be run and do them. Must be called with deferred locked.

Definition at line 400 of file gc_lock.cc.

Wait until all defer functions that have been registered have been run.

You can't call this if a guard is held, as it would deadlock waiting for itself to exit from the critical section.

Definition at line 673 of file gc_lock.cc.

Executes any available deferred work.

Definition at line 384 of file gc_lock.cc.

virtual void Datacratic::GcLockBase::unlink ( ) [pure virtual]

Permanently deletes any resources associated with this lock.

Implemented in Datacratic::SharedGcLock, and Datacratic::GcLock.

bool Datacratic::GcLockBase::updateData ( Data oldValue,
Data newValue 
)

Update with the new value after first checking that the current value is the same as the old value. Returns true if it succeeded; otherwise oldValue is updated with the new old value.

As part of doing this, it will calculate the correct value for visibleEpoch() and, if it has changed, wake up anything waiting on that value, and will run any deferred handlers registered for that value.

Definition at line 346 of file gc_lock.cc.

Wait until everything that's currently visible is no longer accessible.

You can't call this if a guard is held, as it would deadlock waiting for itself to exit from the critical section.

Definition at line 629 of file gc_lock.cc.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator