GNU libmicrohttpd  0.9.29
mhd_threads.h File Reference

Header for platform-independent threads abstraction. More...

#include "mhd_options.h"
#include <stdlib.h>
Include dependency graph for mhd_threads.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MHD_create_named_thread_(t, n, s, r, a)   MHD_create_thread_((t),(s),(r),(a))
 

Typedefs

typedef MHD_THRD_RTRN_TYPE_(MHD_THRD_CALL_SPEC_ * MHD_THREAD_START_ROUTINE_) (void *cls)
 

Functions

int MHD_create_thread_ (MHD_thread_handle_ *thread, size_t stack_size, MHD_THREAD_START_ROUTINE_ start_routine, void *arg)
 

Detailed Description

Header for platform-independent threads abstraction.

Author
Karlson2k (Evgeny Grin)

Provides basic abstraction for threads. Any functions can be implemented as macro on some platforms unless explicitly marked otherwise. Any function argument can be skipped in macro, so avoid variable modification in function parameters.

Warning
Unlike pthread functions, most of functions return nonzero on success.

Definition in file mhd_threads.h.

Macro Definition Documentation

◆ MHD_create_named_thread_

#define MHD_create_named_thread_ (   t,
  n,
  s,
  r,
 
)    MHD_create_thread_((t),(s),(r),(a))

Definition at line 132 of file mhd_threads.h.

Referenced by internal_add_connection(), MHD_create_thread_(), and MHD_start_daemon_va().

Typedef Documentation

◆ MHD_THREAD_START_ROUTINE_

typedef MHD_THRD_RTRN_TYPE_(MHD_THRD_CALL_SPEC_ * MHD_THREAD_START_ROUTINE_) (void *cls)

Signature of main function for a thread.

Parameters
clsclosure argument for the function
Returns
termination code from the thread

Definition at line 111 of file mhd_threads.h.

Function Documentation

◆ MHD_create_thread_()

int MHD_create_thread_ ( MHD_thread_handle_ *  thread,
size_t  stack_size,
MHD_THREAD_START_ROUTINE_  start_routine,
void *  arg 
)

Create a thread and set the attributes according to our options.

If thread is created, thread handle must be freed by #MHD_join_thread_().

Parameters
threadhandle to initialize
stack_sizesize of stack for new thread, 0 for default
start_routinemain function of thread
argargument for start_routine
Returns
non-zero on success; zero otherwise

Create a thread and set the attributes according to our options.

Parameters
threadhandle to initialize
stack_sizesize of stack for new thread, 0 for default
start_routinemain function of thread
argargument for start_routine
Returns
non-zero on success; zero otherwise (with errno set)

Definition at line 186 of file mhd_threads.c.

References MHD_create_named_thread_, MHD_create_thread_(), MHD_set_cur_thread_name_, NULL, and UINT_MAX.

Referenced by MHD_create_thread_().

Here is the call graph for this function:
Here is the caller graph for this function: