Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
gui_throttle.c File Reference
#include "develop/gui_throttle.h"
#include "system/macros.h"
#include "system/atomic.h"
#include "system/dtpthread.h"
#include <stdint.h>
+ Include dependency graph for gui_throttle.c:

Go to the source code of this file.

Data Structures

struct  dt_gui_throttle_task_t
 
struct  dt_gui_throttle_state_t
 

Macros

#define DT_GUI_THROTTLE_RUNTIME_CONF   "processing/gui_throttle_runtime_us"
 

Typedefs

typedef struct dt_gui_throttle_task_t dt_gui_throttle_task_t
 
typedef struct dt_gui_throttle_state_t dt_gui_throttle_state_t
 

Functions

static dt_gui_throttle_task_t_find_task (gpointer source)
 
void dt_gui_throttle_set_timeout_ms (guint timeout_ms)
 
static guint _get_user_timeout_ms (void)
 
static guint _runtime_us_to_ms (const int runtime_us)
 
static guint _effective_timeout_ms (void)
 
static gboolean _dispatch_pending_tasks (gpointer user_data)
 
void dt_gui_throttle_init (int saved_runtime_us_in)
 
void dt_gui_throttle_cleanup (void)
 
void dt_gui_throttle_record_runtime (const dt_throttle_slot_t slot, const gint64 runtime_us)
 
int dt_gui_throttle_get_runtime_us (void)
 
int dt_gui_throttle_get_pipe_runtime_us (const dt_throttle_slot_t slot)
 
guint dt_gui_throttle_get_timeout_ms (void)
 
gint64 dt_gui_throttle_get_timeout_us (void)
 
void dt_gui_throttle_queue (gpointer source, dt_gui_throttle_callback_t callback, gpointer user_data)
 
void dt_gui_throttle_cancel (gpointer source)
 

Variables

static dt_gui_throttle_state_t _gui_throttle = { 0 }
 
static guint _user_timeout_ms = 0
 

Macro Definition Documentation

◆ DT_GUI_THROTTLE_RUNTIME_CONF

#define DT_GUI_THROTTLE_RUNTIME_CONF   "processing/gui_throttle_runtime_us"

Definition at line 27 of file gui_throttle.c.

Typedef Documentation

◆ dt_gui_throttle_state_t

◆ dt_gui_throttle_task_t

Function Documentation

◆ _dispatch_pending_tasks()

static gboolean _dispatch_pending_tasks ( gpointer  user_data)
static

◆ _effective_timeout_ms()

◆ _find_task()

static dt_gui_throttle_task_t * _find_task ( gpointer  source)
static

◆ _get_user_timeout_ms()

static guint _get_user_timeout_ms ( void  )
static

Definition at line 77 of file gui_throttle.c.

References _user_timeout_ms.

Referenced by _effective_timeout_ms().

◆ _runtime_us_to_ms()

static guint _runtime_us_to_ms ( const int  runtime_us)
static

Definition at line 82 of file gui_throttle.c.

References MAX.

Referenced by _effective_timeout_ms().

◆ dt_gui_throttle_cancel()

◆ dt_gui_throttle_cleanup()

◆ dt_gui_throttle_get_pipe_runtime_us()

◆ dt_gui_throttle_get_runtime_us()

int dt_gui_throttle_get_runtime_us ( void  )

◆ dt_gui_throttle_get_timeout_ms()

guint dt_gui_throttle_get_timeout_ms ( void  )

◆ dt_gui_throttle_get_timeout_us()

gint64 dt_gui_throttle_get_timeout_us ( void  )

Definition at line 244 of file gui_throttle.c.

References _effective_timeout_ms().

◆ dt_gui_throttle_init()

◆ dt_gui_throttle_queue()

◆ dt_gui_throttle_record_runtime()

◆ dt_gui_throttle_set_timeout_ms()

void dt_gui_throttle_set_timeout_ms ( guint  timeout_ms)

Maximum time a queued task may wait, in ms. Set by the host from its preferences; 0 disables the timeout.

Definition at line 72 of file gui_throttle.c.

References _user_timeout_ms.

Referenced by dt_init().

Variable Documentation

◆ _gui_throttle

◆ _user_timeout_ms

guint _user_timeout_ms = 0
static

Definition at line 70 of file gui_throttle.c.

Referenced by _get_user_timeout_ms(), and dt_gui_throttle_set_timeout_ms().