mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
sysprof: make scheduler process until deadline elapsed
We don't need to return to the mainloop until our deadline elapses, even if that source didn't finish processing.
This commit is contained in:
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
#define _1_MSEC (G_USEC_PER_SEC / 1000L)
|
#define _1_MSEC (G_USEC_PER_SEC / 1000L)
|
||||||
|
|
||||||
typedef struct
|
typedef struct _SysprofScheduler
|
||||||
{
|
{
|
||||||
GSource source;
|
GSource source;
|
||||||
GQueue queue;
|
GQueue queue;
|
||||||
@ -48,7 +48,7 @@ typedef struct
|
|||||||
gsize last_handler_id;
|
gsize last_handler_id;
|
||||||
} SysprofScheduler;
|
} SysprofScheduler;
|
||||||
|
|
||||||
typedef struct
|
typedef struct _SysprofTask
|
||||||
{
|
{
|
||||||
GList link;
|
GList link;
|
||||||
SysprofSchedulerCallback callback;
|
SysprofSchedulerCallback callback;
|
||||||
@ -77,8 +77,8 @@ sysprof_task_free (SysprofTask *task)
|
|||||||
|
|
||||||
static SysprofTask *
|
static SysprofTask *
|
||||||
sysprof_task_new (SysprofSchedulerCallback callback,
|
sysprof_task_new (SysprofSchedulerCallback callback,
|
||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GDestroyNotify notify)
|
GDestroyNotify notify)
|
||||||
{
|
{
|
||||||
SysprofTask *task;
|
SysprofTask *task;
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ sysprof_scheduler_dispatch (GSource *source,
|
|||||||
{
|
{
|
||||||
task->ready_time = current + interval;
|
task->ready_time = current + interval;
|
||||||
g_queue_push_tail_link (&self->queue, &task->link);
|
g_queue_push_tail_link (&self->queue, &task->link);
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
sysprof_task_free (task);
|
sysprof_task_free (task);
|
||||||
|
|||||||
Reference in New Issue
Block a user