aboutsummaryrefslogtreecommitdiffstats
path: root/src/main_notify.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2008-10-03main_notify: define main_task so we can use it for assertionsEric Wong1-0/+3
It'll be easier to keep track of what code runs in what task/thread this way.
2008-08-16core rewrite (decode,player,outputBuffer,playlist)Eric Wong1-69/+14
This is a huge refactoring of the core mpd process. The queueing/buffering mechanism is heavily reworked. The player.c code has been merged into outputBuffer (the actual ring buffering logic is handled by ringbuf.c); and decode.c actually handles decoding stuff. The end result is several hundreds of lines shorter, even though we still have a lot of DEBUG statements left in there for tracing and a lot of assertions, too.
2008-04-17fix race condition in main_notify.cMax Kellermann1-1/+6
The function wait_main_task() is racy: if the function wakeup_via_cond() sees the mutex is locked just before wait_main_task() executes pthread_cond_wait(), the main thread blocks forever. Work around this issue by adding a "pending" flag just like in my notify.c code. A standards-compliant solution should be implemented later. git-svn-id: https://svn.musicpd.org/mpd/trunk@7365 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-13main_notify: just use cond_signal to wakeup, no need to trylockEric Wong1-11/+1
pthread_cond_signal is a no-op if nothing is waiting on it git-svn-id: https://svn.musicpd.org/mpd/trunk@7351 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12main_notify: use pthread_cond_signal instead of broadcastEric Wong1-1/+1
signal is all we need since we only have one waiter and likely faster git-svn-id: https://svn.musicpd.org/mpd/trunk@7349 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12Fix a deadlock after pause/nextEric Wong1-0/+1
Oops, forgot to unlock a mutex git-svn-id: https://svn.musicpd.org/mpd/trunk@7348 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-04-12Fix the problem of songs not advancing without client activityEric Wong1-0/+130
The select() in the main event loop blocks now (saving us many unnecessary wakeups). This interacted badly with the threads that were trying to wakeup the main task via pthread_cond_signal() since the main task was not blocked on a condition variable, but on select(). So now if we detect a need to wakeup the player, we write to a pipe which select() is watching instead of blindly calling pthread_cond_signal(). git-svn-id: https://svn.musicpd.org/mpd/trunk@7347 09075e82-0dd4-0310-85a5-a0d7c8717e4f