Cyber Garage Portable Runtime (CGPR) for C
mutex.h File Reference
#include <cgpr/util/typedef.h>
#include <pthread.h>

Data Structures

struct  _CGMutex
 The generic wrapper struct for mUPnP's mutexes. More...
 

Typedefs

typedef struct _CGMutex CGMutex
 The generic wrapper struct for mUPnP's mutexes.
 

Functions

CGMutexcg_mutex_new (void)
 
bool cg_mutex_delete (CGMutex *mutex)
 
bool cg_mutex_lock (CGMutex *mutex)
 
bool cg_mutex_unlock (CGMutex *mutex)
 

Typedef Documentation

◆ CGMutex

typedef struct _CGMutex CGMutex

The generic wrapper struct for mUPnP's mutexes.

This wrapper has been created to enable 100% code compatibility for different platforms (Linux, Win32 etc..)

Function Documentation

◆ cg_mutex_delete()

bool cg_mutex_delete ( CGMutex * mutex)

Destroy a mutex

Parameters
mutexThe mutex to destroy

◆ cg_mutex_lock()

bool cg_mutex_lock ( CGMutex * mutex)

Acquire a mutex lock

Parameters
mutexMutex to lock

◆ cg_mutex_new()

CGMutex * cg_mutex_new ( void )

Create a new mutex

◆ cg_mutex_unlock()

bool cg_mutex_unlock ( CGMutex * mutex)

Release a locked mutex

Parameters
mutexMutex to unlock