Concord - C Discord API library
A Discord API wrapper library written in C

A global threadpool for worker-threads handling. More...

Collaboration diagram for Global threadpool:

Functions

int discord_worker_global_init (void)
 Initialize global threadpool and priority queue. More...
 
void discord_worker_global_cleanup (void)
 Cleanup global threadpool and priority queue. More...
 
CCORDcode discord_worker_add (struct discord *client, void(*callback)(void *data), void *data)
 Run a callback from a worker thread. More...
 
CCORDcode discord_worker_join (struct discord *client)
 Wait until worker-threads being used by client have been joined. More...
 

Detailed Description

A global threadpool for worker-threads handling.

Function Documentation

◆ discord_worker_global_init()

int discord_worker_global_init ( void  )

Initialize global threadpool and priority queue.

Returns
0 on success, 1 if it has already been initialized

◆ discord_worker_global_cleanup()

void discord_worker_global_cleanup ( void  )

Cleanup global threadpool and priority queue.

◆ discord_worker_add()

CCORDcode discord_worker_add ( struct discord client,
void(*)(void *data)  callback,
void *  data 
)

Run a callback from a worker thread.

Parameters
clientthe client that will be using the worker thread
callbackuser callback to be executed
datauser data to be passed to callback
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ discord_worker_join()

CCORDcode discord_worker_join ( struct discord client)

Wait until worker-threads being used by client have been joined.

Parameters
clientthe client currently using a worker thread
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary