Mercurial > audlegacy-plugins
comparison src/alsa-ng/alsa-core.c @ 3175:1bb4cad57923
alsa-ng: alsaplug_flush(): It is good practise to lock the same mutex as the waiting threads while calling g_cond_broadcast.
| author | Tomasz Mon <desowin@gmail.com> |
|---|---|
| date | Sat, 16 May 2009 15:41:43 +0200 |
| parents | 8106e1b31115 |
| children | dca77b467ea2 |
comparison
equal
deleted
inserted
replaced
| 3174:8106e1b31115 | 3175:1bb4cad57923 |
|---|---|
| 279 alsaplug_flush(gint time) | 279 alsaplug_flush(gint time) |
| 280 { | 280 { |
| 281 /* make the request... */ | 281 /* make the request... */ |
| 282 g_mutex_lock(pcm_state_mutex); | 282 g_mutex_lock(pcm_state_mutex); |
| 283 flush_request = time; | 283 flush_request = time; |
| 284 g_mutex_unlock(pcm_state_mutex); | |
| 285 g_cond_broadcast(pcm_state_cond); | 284 g_cond_broadcast(pcm_state_cond); |
| 285 g_mutex_unlock(pcm_state_mutex); | |
| 286 | 286 |
| 287 /* ...then wait for the transaction to complete. */ | 287 /* ...then wait for the transaction to complete. */ |
| 288 g_mutex_lock(pcm_state_mutex); | 288 g_mutex_lock(pcm_state_mutex); |
| 289 g_cond_wait(pcm_state_cond, pcm_state_mutex); | 289 g_cond_wait(pcm_state_cond, pcm_state_mutex); |
| 290 g_mutex_unlock(pcm_state_mutex); | 290 g_mutex_unlock(pcm_state_mutex); |
