QuickIO  0.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
fair.h
Go to the documentation of this file.
1 
14 #include "qev.h"
15 
19 typedef struct qev_fair qev_fair_t;
20 
45  const gchar *name,
46  const guint total,
47  const gsize pressure,
48  const gsize min);
49 
56 void qev_fair_free(qev_fair_t *fair);
57 
77 gboolean qev_fair_use(qev_fair_t *fair, const gsize in_use, const gsize wants);
78 
94 gboolean qev_fair_used(qev_fair_t *fair, const gsize in_use, const gsize added);
95 
104 void qev_fair_return(qev_fair_t *fair, const gsize giving);
105 
109 gsize qev_fair_get_usage(qev_fair_t *fair);
110 
119 void qev_fair_set_total(qev_fair_t *fair, const gsize total);
120 
129 void qev_fair_set_pressure(qev_fair_t *fair, const gsize pressure);
130 
139 void qev_fair_set_min(qev_fair_t *fair, const gsize min);
gboolean qev_fair_used(qev_fair_t *fair, const gsize in_use, const gsize added)
Like qev_fair_use, except this one just tells the fair pool that the number of resources has already ...
void qev_fair_set_min(qev_fair_t *fair, const gsize min)
Change the min allocation for the pool.
struct qev_fair qev_fair_t
Don't even try modifying this.
Definition: fair.h:19
qev_fair_t * qev_fair_new(const gchar *name, const guint total, const gsize pressure, const gsize min)
Create a new limited pool that needs allocating.
gboolean qev_fair_use(qev_fair_t *fair, const gsize in_use, const gsize wants)
Determines if the given number of resources may be used.
void qev_fair_return(qev_fair_t *fair, const gsize giving)
Return used resources to the pool.
void qev_fair_free(qev_fair_t *fair)
Free the fairness pool.
gsize qev_fair_get_usage(qev_fair_t *fair)
Get how much of the shared resource is currently in use.
Provides all the qev_* functions that are needed for creating an event loop.
void qev_fair_set_pressure(qev_fair_t *fair, const gsize pressure)
Change the pressure of the pool.
void qev_fair_set_total(qev_fair_t *fair, const gsize total)
Set the total number of things the pool may allocate.