Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

phMutex.h File Reference

#include <phStdint.h>
#include <phObject.h>

Go to the source code of this file.


class  phMutex
 phMutex provides platform independent locking mechanisms to the Phission code. The phMutex is a recursive implemented mutex. Multiple mutexes can be obtained by a thread by calling the phMutex::lock() method and each successful phMutex::lock() should be matched with a call to the phMutex::unlock() method. If there isn't one phMutex::unlock() call for every phMutex::lock()/phMutextryLock() call that succeeded, deadlock could occur in other threads that are trying to obtain the lock. Recursive mutexes are necessary for a system such as Phission where a call to the current object's method may also call other methods that belong to the same instance of the object. Those other methods could be called on their own as well. Without recursive mutexes, the one scope calling into another scope (scope being separate methods or blocks of code) will deadlock on the second attempt at locking. More...


#define phTHIS_LOOSE_LOCK(l)
#define phTHIS_LOCK(l)
#define phTHIS_TRYLOCK(l, gotlock)
#define phTHIS_LOOSE_TRYLOCK(l, gotlock)
#define phTHIS_LOOSE_UNLOCK(l)
#define phTHIS_UNLOCK(l)
#define phTHIS_ERROR_UNLOCK(l)
#define phTHIS_UNLOCK_RET(l, success_value, error_value)
#define phMUTEX_LOCK(m, l)
#define phMUTEX_TRYLOCK(m, l, gotlock)
#define phMUTEX_LOOSE_TRYLOCK(m, l, gotlock)
#define phMUTEX_LOOSE_LOCK(m, l)
#define phMUTEX_UNLOCK(m, l)
#define phMUTEX_LOOSE_UNLOCK(m, l)
#define phMUTEX_ERROR_UNLOCK(m, l)
#define phMUTEX_UNLOCK_RET(m, l, success_value, error_value)


typedef ph_mutex_info_tph_mutex_info

Copyright (C) 2002 - 2007 Philip D.S. Thoren ( )
University Of Massachusetts at Lowell
Robotics Lab Logo

Generated on Sat Jun 16 02:44:13 2007 for phission by  doxygen 1.4.4