GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  AL_WAIT_COND (3)

NAME

al_wait_cond - Allegro 5 API

CONTENTS

Synopsis
Description
See Also

SYNOPSIS

C]
#include <allegro5/allegro.h>

void al_wait_cond(ALLEGRO_COND *cond, ALLEGRO_MUTEX *mutex) ]

DESCRIPTION

On entering this function, C]mutex] must be locked by the calling thread. The function will atomically release C]mutex] and block on C]cond]. The function will return when C]cond] is "signalled", acquiring the lock on the mutex in the process.

Example of proper use:
C]
al_lock_mutex(mutex);
while (something_not_true) {
    al_wait_cond(cond, mutex);
}
do_something();
al_unlock_mutex(mutex);
]

The mutex should be locked before checking the condition, and should be rechecked al_wait_cond(3) returns. al_wait_cond(3) can return for other reasons than the condition becoming true (e.g. the process was signalled). If multiple threads are blocked on the condition variable, the condition may no longer be true by the time the second and later threads are unblocked. Remember not to unlock the mutex prematurely.

SEE ALSO

al_wait_cond_until(3), al_broadcast_cond(3), al_signal_cond(3).

Search for    or go to Top of page |  Section 3 |  Main Index


Allegro reference manual AL_WAIT_COND (3)

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.