osdMutexCreate

osdMutexCreate

osd

1998 12-05


NAME

osdMutexCreate - light weight mutex


SYNOPSIS

long osdMutexCreate(OSD_Mutex *mutex)

osdMutexCreate() sets up an OSD_Mutex specified by mutex. osdMutexCreate() must be called for a OSD_Mutex before other mutex operations can be used on it.


An OSD_Mutex is a light weight mutex intended for thread synchronization. It is only available with platforms that support threads, and is usually implemented as some form of spinlock.


On some platforms, space is allocated during osdMutexCreate(). This space can be freed when the OSD_Mutex is no longer needed by osdMutexDestroy().


When compiling, the proper value for OSD_THREADS must be defined. Currently the following values are supported:



OSD_CTHREAD_PKG for the cthread package available in the public domain for some Unix systems.
OSD_SGI_SPROC for Silicon Graphics Irix platforms.
OSD_WIN32_THREADS for Win32 platforms (Windows NT, Windows 95).
OSD_NO_THREADS for no thread support.


Return TRUE on success and FALSE on failure.


ARGUMENTS


mutex pointer to a OSD_Mutex