Macros | Functions | Variables
threadpool.c File Reference
#include "uv-common.h"
#include "unix/internal.h"
#include <stdlib.h>
Include dependency graph for threadpool.c:

Go to the source code of this file.

Macros

#define MAX_THREADPOOL_SIZE   1024
 

Functions

static void init_once (void)
 
static void init_threads (void)
 
static void post (QUEUE *q, enum uv__work_kind kind)
 
static void reset_once (void)
 
static unsigned int slow_work_thread_threshold (void)
 
static void uv__cancelled (struct uv__work *w)
 
static void uv__queue_done (struct uv__work *w, int err)
 
static void uv__queue_work (struct uv__work *w)
 
static int uv__work_cancel (uv_loop_t *loop, uv_req_t *req, struct uv__work *w)
 
void uv__work_done (uv_async_t *handle)
 
void uv__work_submit (uv_loop_t *loop, struct uv__work *w, enum uv__work_kind kind, void(*work)(struct uv__work *w), void(*done)(struct uv__work *w, int status))
 
int uv_cancel (uv_req_t *req)
 
 UV_DESTRUCTOR (static void cleanup(void))
 
int uv_queue_work (uv_loop_t *loop, uv_work_t *req, uv_work_cb work_cb, uv_after_work_cb after_work_cb)
 
static void worker (void *arg)
 

Variables

static uv_cond_t cond
 
static uv_thread_t default_threads [4]
 
static QUEUE exit_message
 
static unsigned int idle_threads
 
static uv_mutex_t mutex
 
static unsigned int nthreads
 
static uv_once_t once = UV_ONCE_INIT
 
static QUEUE run_slow_work_message
 
static QUEUE slow_io_pending_wq
 
static unsigned int slow_io_work_running
 
static uv_thread_tthreads
 
static QUEUE wq
 

Macro Definition Documentation

◆ MAX_THREADPOOL_SIZE

#define MAX_THREADPOOL_SIZE   1024

Definition at line 30 of file threadpool.c.

Function Documentation

◆ init_once()

static void init_once ( void  )
static

Definition at line 243 of file threadpool.c.

◆ init_threads()

static void init_threads ( void  )
static

Definition at line 188 of file threadpool.c.

◆ post()

static void post ( QUEUE q,
enum uv__work_kind  kind 
)
static

Definition at line 142 of file threadpool.c.

◆ reset_once()

static void reset_once ( void  )
static

Definition at line 236 of file threadpool.c.

◆ slow_work_thread_threshold()

static unsigned int slow_work_thread_threshold ( void  )
static

Definition at line 45 of file threadpool.c.

◆ uv__cancelled()

static void uv__cancelled ( struct uv__work w)
static

Definition at line 49 of file threadpool.c.

◆ uv__queue_done()

static void uv__queue_done ( struct uv__work w,
int  err 
)
static

Definition at line 325 of file threadpool.c.

◆ uv__queue_work()

static void uv__queue_work ( struct uv__work w)
static

Definition at line 318 of file threadpool.c.

◆ uv__work_cancel()

static int uv__work_cancel ( uv_loop_t loop,
uv_req_t req,
struct uv__work w 
)
static

Definition at line 269 of file threadpool.c.

◆ uv__work_done()

void uv__work_done ( uv_async_t handle)

Definition at line 295 of file threadpool.c.

◆ uv__work_submit()

void uv__work_submit ( uv_loop_t loop,
struct uv__work w,
enum uv__work_kind  kind,
void(*)(struct uv__work *w)  work,
void(*)(struct uv__work *w, int status done 
)

Definition at line 256 of file threadpool.c.

◆ uv_cancel()

int uv_cancel ( uv_req_t req)

Definition at line 358 of file threadpool.c.

◆ UV_DESTRUCTOR()

UV_DESTRUCTOR ( static void   cleanupvoid)

Definition at line 164 of file threadpool.c.

◆ uv_queue_work()

int uv_queue_work ( uv_loop_t loop,
uv_work_t req,
uv_work_cb  work_cb,
uv_after_work_cb  after_work_cb 
)

Definition at line 338 of file threadpool.c.

◆ worker()

static void worker ( void *  arg)
static

Definition at line 57 of file threadpool.c.

Variable Documentation

◆ cond

uv_cond_t cond
static

Definition at line 33 of file threadpool.c.

◆ default_threads

uv_thread_t default_threads[4]
static

Definition at line 39 of file threadpool.c.

◆ exit_message

QUEUE exit_message
static

Definition at line 40 of file threadpool.c.

◆ idle_threads

unsigned int idle_threads
static

Definition at line 35 of file threadpool.c.

◆ mutex

uv_mutex_t mutex
static

Definition at line 34 of file threadpool.c.

◆ nthreads

unsigned int nthreads
static

Definition at line 37 of file threadpool.c.

◆ once

uv_once_t once = UV_ONCE_INIT
static

Definition at line 32 of file threadpool.c.

◆ run_slow_work_message

QUEUE run_slow_work_message
static

Definition at line 42 of file threadpool.c.

◆ slow_io_pending_wq

QUEUE slow_io_pending_wq
static

Definition at line 43 of file threadpool.c.

◆ slow_io_work_running

unsigned int slow_io_work_running
static

Definition at line 36 of file threadpool.c.

◆ threads

uv_thread_t* threads
static

Definition at line 38 of file threadpool.c.

◆ wq

QUEUE wq
static

Definition at line 41 of file threadpool.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:34