HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_TaskLockT< NESTED > Class Template Reference

#include <UT_TaskLock.h>

+ Inheritance diagram for UT_TaskLockT< NESTED >:

Public Types

typedef UT_LockScopeType
< UT_TaskLockT< NESTED > > 
Scope
 Class for auto-unlocking. More...
 

Public Member Functions

 UT_TaskLockT ()
 
 ~UT_TaskLockT ()
 
void lock ()
 
void lock (bool &was_first)
 
bool timedLock (int timeout)
 
bool tryLock ()
 
bool safeLock ()
 
void unlock ()
 
bool hasLock ()
 

Friends

class Scope
 

Detailed Description

template<bool NESTED>
class UT_TaskLockT< NESTED >

A recursive mutex class for synchronizing amongst tasks defined by UT_TaskScope.

The assumptions that UT_TaskScope uses for tasks are:

  • Tasks are hierarchical in a forest of trees
  • When child tasks are running, the parent task is not
  • Child tasks always finish before their parent task

Requirements:

  • You must unlock before your own task ends
  • You must unlock your lock before waiting for a child task to end

Definition at line 48 of file UT_TaskLock.h.

Member Typedef Documentation

template<bool NESTED>
typedef UT_LockScopeType<UT_TaskLockT<NESTED> > UT_TaskLockT< NESTED >::Scope

Class for auto-unlocking.

Definition at line 264 of file UT_TaskLock.h.

Constructor & Destructor Documentation

template<bool NESTED>
UT_TaskLockT< NESTED >::UT_TaskLockT ( )
inline

Definition at line 211 of file UT_TaskLock.h.

template<bool NESTED>
UT_TaskLockT< NESTED >::~UT_TaskLockT ( )
inline

Definition at line 215 of file UT_TaskLock.h.

Member Function Documentation

template<bool NESTED>
bool UT_TaskLockT< NESTED >::hasLock ( )
inline

Definition at line 258 of file UT_TaskLock.h.

template<bool NESTED>
void UT_TaskLockT< NESTED >::lock ( )
inline

Definition at line 219 of file UT_TaskLock.h.

template<bool NESTED>
void UT_TaskLockT< NESTED >::lock ( bool &  was_first)
inline

Same as lock() except it also returns if it was the first time this task scope obtained the lock (ie. non-recursively).

Definition at line 228 of file UT_TaskLock.h.

template<bool NESTED>
bool UT_TaskLockT< NESTED >::safeLock ( )
inline

Definition at line 247 of file UT_TaskLock.h.

template<bool NESTED>
bool UT_TaskLockT< NESTED >::timedLock ( int  timeout)
inline

Definition at line 234 of file UT_TaskLock.h.

template<bool NESTED>
bool UT_TaskLockT< NESTED >::tryLock ( )
inline

Definition at line 242 of file UT_TaskLock.h.

template<bool NESTED>
void UT_TaskLockT< NESTED >::unlock ( )
inline

Definition at line 253 of file UT_TaskLock.h.

Friends And Related Function Documentation

template<bool NESTED>
friend class Scope
friend

Definition at line 51 of file UT_TaskLock.h.


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