al_lock_mutex
void al_lock_mutex(ALLEGRO_MUTEX *mutex)
Introduced in 5.0.0
Acquire the lock on mutex
. If the mutex is already locked by another thread, the call will block until the mutex becomes available and locked.
If the mutex is already locked by the calling thread, then the behaviour depends on whether the mutex was created with al_create_mutex or al_create_mutex_recursive. In the former case, the behaviour is undefined; the most likely behaviour is deadlock. In the latter case, the count in the mutex will be incremented and the call will return immediately.
See also: al_unlock_mutex.
We don't yet have al_mutex_trylock.
Examples: ex_threads2
Most helpful discussions:
- Allegro 5 Threading Interface (1)
- Synchronizing Threads
- Controlling threads
- Allegro 5.2.1.1 released!
- Severe performance problems with a lot of bitmaps and subbitmaps.
- al_lock_mutex() locks for both read and writes?
- Controllers configuration
- Thread problem
- shows error when creating class DATA in Xcode for c project
- Intermittent Collision Detection Crashing
Other recent discussions:
- Simple C++ video player for non-photographic animation
- [A5] Need help with loading screens and multithreading
- Question regarding multithreading
- help with threads
- Multithreading Related Problems
- Multithreading and events
- [A5] TTF Fonts not caching correctly?
- Threading Problems
- Allegro 5 threads
- Mac OS X Joystick Bug (A5)