YAZ  5.34.0
Data Structures | Functions
thread_create.c File Reference

Implements thread creation wrappers. More...

#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stddef.h>
#include <yaz/xmalloc.h>
#include <yaz/log.h>
#include <yaz/thread_create.h>

Go to the source code of this file.

Data Structures

struct  yaz_thread
 

Functions

yaz_thread_t yaz_thread_create (void *(*start_routine)(void *p), void *arg)
 create thread More...
 
void yaz_thread_join (yaz_thread_t *tp, void **value_ptr)
 join thread More...
 
void yaz_thread_detach (yaz_thread_t *tp)
 detach thread More...
 

Detailed Description

Implements thread creation wrappers.

Definition in file thread_create.c.

Function Documentation

◆ yaz_thread_create()

yaz_thread_t yaz_thread_create ( void *(*)(void *p)  start_routine,
void *  arg 
)

create thread

Parameters
start_routinethread handler
arguser data to be passed to handler
Returns
thread_id identifier if successful; NULL on failure

Definition at line 55 of file thread_create.c.

References yaz_thread::data, xfree, and xmalloc.

Referenced by tcpip_straddr().

◆ yaz_thread_detach()

void yaz_thread_detach ( yaz_thread_t tp)

detach thread

Parameters
tpthread_id reference .. Will be 0 upon completion

Definition at line 105 of file thread_create.c.

References xfree.

◆ yaz_thread_join()

void yaz_thread_join ( yaz_thread_t tp,
void **  value_ptr 
)

join thread

Parameters
tpthread_id reference .. Will be 0 upon completion
value_ptrref pointer to routine result (0 if not needed)

Definition at line 86 of file thread_create.c.

References xfree.

Referenced by tcpip_close(), and wait_resolver_thread().