diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-02-13 13:28:45 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2006-02-13 13:28:45 +0000 |
commit | bbaf1543bd77e5c428e5e4c7d40fde0a42bf3daf (patch) | |
tree | 265976ec19240e72faad21faea37b7207bd6e50c /polyp/mainloop.h | |
parent | 4ab432a81952b5ef608775522d27ad9709b97307 (diff) |
Split mainloop_iterate() into three, distinct parts. Allows for more flexible
use, like having the poll() run in a separate thread.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@478 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'polyp/mainloop.h')
-rw-r--r-- | polyp/mainloop.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/polyp/mainloop.h b/polyp/mainloop.h index 06764907..2be9e6ff 100644 --- a/polyp/mainloop.h +++ b/polyp/mainloop.h @@ -46,10 +46,27 @@ pa_mainloop *pa_mainloop_new(void); /** Free a main loop object */ void pa_mainloop_free(pa_mainloop* m); -/** Run a single iteration of the main loop. Returns a negative value -on error or exit request. If block is nonzero, block for events if -none are queued. Optionally return the return value as specified with -the main loop's quit() routine in the integer variable retval points + +/** Prepare for a single iteration of the main loop. Returns a negative value +on error or exit request. timeout specifies a maximum timeout for the subsequent +poll, or -1 for blocking behaviour. Defer events are also dispatched when this +function is called. On success returns the number of source dispatched in this +iteration.*/ +int pa_mainloop_prepare(pa_mainloop *m, int timeout); +/** Execute the previously prepared poll. Returns a negative value on error.*/ +int pa_mainloop_poll(pa_mainloop *m); +/** Dispatch timeout and io events from the previously executed poll. Returns +a negative value on error. On success returns the number of source dispatched. */ +int pa_mainloop_dispatch(pa_mainloop *m); + +/** Return the return value as specified with the main loop's quit() routine. */ +int pa_mainloop_get_retval(pa_mainloop *m); + +/** Run a single iteration of the main loop. This is a convenience function +for pa_mainloop_prepare(), pa_mainloop_poll() and pa_mainloop_dispatch(). +Returns a negative value on error or exit request. If block is nonzero, +block for events if none are queued. Optionally return the return value as +specified with the main loop's quit() routine in the integer variable retval points to. On success returns the number of source dispatched in this iteration. */ int pa_mainloop_iterate(pa_mainloop *m, int block, int *retval); |