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

CCORDcode discord_worker_global_init (long flags)
 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()

CCORDcode discord_worker_global_init ( long  flags)

Initialize global threadpool and priority queue.

Parameters
flagsunused for now, but reserved for future use
Returns
CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary

◆ 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