SDL_CreateMutex

Name

SDL_CreateMutex -- Create a mutex

Synopsis

uses
SDL;

function SDL_CreateMutex : PSDL_Mutex;

Description

Create a new, unlocked mutex.

Examples

var
mut : PSDL_mutex;
.
.
.
mut := SDL_CreateMutex;
.
.
if ( SDL_mutexP( mut ) = -1 ) then
begin
MessageBox( 0, 'Couldn''t lock mutex', 'Information', MB_OK or MB_ICONHAND );
halt( -1 );
end;
.
// Do stuff while mutex is locked
.
.
if ( SDL_mutexV( mut ) = -1 ) then
begin
MessageBox( 0, 'Couldn''t unlock mutex', 'Information', MB_OK or MB_ICONHAND );
halt( -1 );
end;

SDL_DestroyMutex( mut );

See Also

SDL_mutexP, SDL_mutexV, SDL_DestroyMutex