Threads


Typedefs

typedef void *(*) IX_START_FCT (void *)
 prototype of function which is executed in thread
typedef void(*) IX_EXIT_FCT (void *pt)
 prototpye of function which is executed when thread is finished (argument is pointer to ix_thread_t)
typedef ix_thread_s ix_thread_t
 handle to ix thread

Functions

ix_thread_tix_thread_new (IX_START_FCT sfct, IX_EXIT_FCT efct, void *parg, char *name)
int ix_thread_stop (ix_thread_t *pt)
void ix_thread_exit (ix_thread_t *pt)
void ix_thread_free (ix_thread_t *pt)
void * ix_thread_getarg (ix_thread_t *pt)
char * ix_thread_getname (ix_thread_t *pt)

Detailed Description

Some utility and wrapper functions for thread handling

Function Documentation

void ix_thread_exit ( ix_thread_t pt  ) 

should be called at end of thread execution in end function

Parameters:
pt ix thread handle
Returns:
void

void ix_thread_free ( ix_thread_t pt  ) 

frees memory allocated to thread

Parameters:
pt ix thread handle

void* ix_thread_getarg ( ix_thread_t pt  ) 

returns user-data in start-fct start-fct gets ix_thread_t pointer as argument

Parameters:
pt ix thread handle
Returns:
  • user-data

char* ix_thread_getname ( ix_thread_t pt  ) 

returns thread name given in ix_thread_new

Parameters:
pt ix thread handle
Returns:
  • thread name

ix_thread_t* ix_thread_new ( IX_START_FCT  sfct,
IX_EXIT_FCT  efct,
void *  parg,
char *  name 
)

creates new thread and starts execution of start-function

Parameters:
sfct start function
efct exit function
parg userdata (to get userdata in start-fct call parg = ix_thread_getarg( start-fct-arg );
name just a name for debugging purpose
Returns:
  • 0: OK
  • <0: Error

int ix_thread_stop ( ix_thread_t pt  ) 

stops thread execution

Parameters:
pt ix thread handle
Returns:
  • 0: OK
  • <0: Error


Generated on 4 Mar 2014 for ixtools by  doxygen 1.4.7