7f4b6b9c0e
A ClutterTimeoutPool is a source for the GLib main loop which pools multiple timeout functions. The pool is always sorted so that the first timeout to expire is also the first element of the pool; hence, extraction is a constant time operation. This also makes the usage of multiple timeouts at the same priority not compete for a timeslice of the main loop, leading to starvation.
21 lines
829 B
C
21 lines
829 B
C
#ifndef __CLUTTER_TIMEOUT_POOL_H__
|
|
#define __CLUTTER_TIMEOUT_POOL_H__
|
|
|
|
#include <glib.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
typedef struct _ClutterTimeoutPool ClutterTimeoutPool;
|
|
|
|
ClutterTimeoutPool *clutter_timeout_pool_new (gint priority);
|
|
guint clutter_timeout_pool_add (ClutterTimeoutPool *pool,
|
|
guint interval,
|
|
GSourceFunc func,
|
|
gpointer data,
|
|
GDestroyNotify notify);
|
|
void clutter_timeout_pool_remove (ClutterTimeoutPool *pool,
|
|
guint id);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __CLUTTER_TIMEOUT_POOL_H__ */
|