a0LockMutex()

Locks a mutex.


Syntax

a0tError a0LockMutex(
a0tMutex *mutex );

Arguments

Namerd/wrDescription
mutex write Mutex descriptor to lock.

Description

This routine locks the mutex pointed by mutex, if it is unlocked. If the mutex is already locked, the thread blocks until it be unlocked and lock it.


Return Values

If an error condition occurs, it returns the error code, otherwise it returns A0ErrOk. Possible values are as follows:
Error CodeDescription
A0ErrInvMutex The mutex descriptor is invalid.
A0ErrLockedMutex Locking this mutex causes a deadlock.
A0ErrOkSuccessful completion.

See Also

a0NewMutex() a0DisposeMutex() a0UnlockMutex()