kre_threads.c File Reference

kREproxy threads management interface implementation More...

#include "kre_threads.h"

Functions

void kre_threads_register_one_thread (struct kre_thread *t)
 Registration one thread.
void kre_threads_register (kre_threads *t)
 Registration group of thread.
int kre_threads_unregister (kre_threads *t)
 Unregistration group of thread.
struct kre_threadkre_threads_fff (kre_threads t)
 Find Firs Free kre_thread structure.
int kre_threads_find_by_pid (pid_t p, kre_threads t)
 Find localization of kre_thread in kre_threads set by pid.
struct kre_threadkre_threads_get_by_id (int id, kre_threads t)
 Return kre thread by id.
int kre_threads_should_work (struct kre_thread *t)
 It can tell whether kthread should work or finish all jobs.
void kre_threads_complete (struct kre_thread *t)
 Set things, and inform other task that actual task is completed.
int kre_threads_init (struct kre_thread *t, int(*f)(void *), void *data)
 Initialization of thread.
int kre_threads_start (struct kre_thread *t)
 Starting the new thread.
int kre_threads_stop (struct kre_thread *t)
 The main cause of exist this function is to kill main kreproxy server thread in clear way.


Detailed Description

kREproxy threads management interface implementation


Function Documentation

void kre_threads_complete ( struct kre_thread t  ) 

Set things, and inform other task that actual task is completed.

Parameters:
t Current kre thread structure.

struct kre_thread* kre_threads_fff ( kre_threads  t  )  [read]

Find Firs Free kre_thread structure.

Parameters:
t Set of threads to search.
Returns:
Thread which was found or NULL.

int kre_threads_find_by_pid ( pid_t  p,
kre_threads  t 
)

Find localization of kre_thread in kre_threads set by pid.

Parameters:
p Function search t set looking for pid p.
t Set of kre threads.
Returns:
id of kre_thread struct in set of kre threads or -1 if not found.

struct kre_thread* kre_threads_get_by_id ( int  id,
kre_threads  t 
) [read]

Return kre thread by id.

Parameters:
id Identyficator returned for example by kre_threads_find_by_pid().
t Set of kre threads.

int kre_threads_init ( struct kre_thread t,
int(*)(void *)  f,
void *  data 
)

Initialization of thread.

Parameters:
t Thread to initlize.
f Thread function.
data Pointer to external thread data. NOT WORK AT NOW.
Returns:
Error report or 0 if ok.

void kre_threads_register_one_thread ( struct kre_thread t  ) 

Registration one thread.

This can be used to register main kREproxy server thread.

int kre_threads_should_work ( struct kre_thread t  ) 

It can tell whether kthread should work or finish all jobs.

Parameters:
t Current thread structure.
Returns:
0 - if should stop, 1 - if should work.

int kre_threads_start ( struct kre_thread t  ) 

Starting the new thread.

Parameters:
t Kreporxy thread to start.
Returns:
Error report.

int kre_threads_stop ( struct kre_thread t  ) 

The main cause of exist this function is to kill main kreproxy server thread in clear way.

Parameters:
t kre_thread structure with running task.
Returns:
Error output.


Generated on Fri Feb 20 19:46:05 2009 for kREproxy by  doxygen 1.5.8