gml_GlobalMutex.h

Go to the documentation of this file.
00001 /**
00002  * @file gml_GlobalMutex.h
00003  *
00004  *    Wrapper around APR's cross-process mutexes.
00005  *
00006  *  Copyright (c) 2004 CLIPS-IMAG
00007  *
00008  *  See the file "gml_LicenseTerms.txt" for information on usage and redistribution
00009  *  of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00010  *
00011  *  Created in December, 2004 (JL).
00012  */
00013 #ifndef __GML_GLOBAL_MUTEX__
00014 #define __GML_GLOBAL_MUTEX__
00015 
00016 #include "gml/base/gml_Types.h"
00017 #include "gml/base/gml_Errors.h"
00018 
00019 /**
00020  * gml_TGlobalMutex --
00021  *
00022  *   Opaque type for cross-process mutexes.
00023  */
00024 typedef struct gml_TGlobalMutex_* gml_TGlobalMutex;
00025 
00026 /**
00027  * gml_GlobalMutexCreate --
00028  *
00029  *   Create a cross process mutex identified system-wide by <name>.
00030  *   If no name is provided, one will be generated and returned.
00031  */
00032 GML_EXTERN_C
00033 gml_TError gml_GlobalMutex_Open    (gml_TGlobalMutex* mutex, UInt32* name);
00034 
00035 /**
00036  * gml_GlobalMutexLock --
00037  *
00038  *   Acquire an exclusive lock on a mutex.
00039  *   The result of locking a mutex twice from the same thread is undefined.
00040  */
00041 GML_EXTERN_C
00042 void gml_GlobalMutex_Lock     (gml_TGlobalMutex mutex);
00043 
00044 /**
00045  * gml_GlobalMutexLock --
00046  *
00047  *   Release a locked mutex.
00048  *   It is not an error to unlock a mutex multiple times.
00049  *   Behavior is undefined is the mutex has never been locked before.
00050  */
00051 GML_EXTERN_C
00052 void gml_GlobalMutex_Unlock   (gml_TGlobalMutex mutex);
00053 
00054 /**
00055  * gml_GlobalMutexClose --
00056  *
00057  *   Release any resources claimed by a mutex.
00058  */
00059 GML_EXTERN_C
00060 void gml_GlobalMutex_Close (gml_TGlobalMutex* mutex);
00061 
00062 
00063 #endif /* __GML_GLOBAL_MUTEX__ */
00064 
Generated on Tue Jun 12 14:03:27 2007 for gml by Doxygen 1.5.2.