#include <linux/kthread.h>
#include <linux/netdevice.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <asm/semaphore.h>
#include "kre_debug.h"
#include "kre_network.h"
Go to the source code of this file.
Data Structures | |
struct | kre_thread |
kREproxy thread representation More... | |
Defines | |
#define | KRE_NAME "kreproxythread" |
#define | KRE_NOT_INITIALIZED 0 |
#define | KRE_INITIALIZED 1 |
#define | KRE_RUNNING 2 |
#define | KRE_SHOULD_STOP 3 |
#define | KRE_COMPLETED 4 |
#define | KRE_MAX_THREADS 10 |
Typedefs | |
typedef struct kre_thread | kre_threads [10] |
kREproxy thread group representation This should be declared once in global scope. | |
Functions | |
void | kre_threads_register_one_thread (struct kre_thread *t) |
Registration one thread. | |
void | kre_threads_register (kre_threads *) |
Registration group of thread. | |
int | kre_threads_unregister (kre_threads *) |
Unregistration group of thread. | |
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. | |
struct kre_thread * | kre_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_thread * | kre_threads_get_by_id (int id, kre_threads t) |
Return kre thread by id. | |
void | kre_threads_complete (struct kre_thread *t) |
Set things, and inform other task that actual task is completed. | |
int | kre_threads_should_work (struct kre_thread *t) |
It can tell whether kthread should work or finish all jobs. | |
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. |
void kre_threads_complete | ( | struct kre_thread * | t | ) |
Set things, and inform other task that actual task is completed.
t | Current kre thread structure. |
struct kre_thread* kre_threads_fff | ( | kre_threads | t | ) | [read] |
Find Firs Free kre_thread structure.
t | Set of threads to search. |
int kre_threads_find_by_pid | ( | pid_t | p, | |
kre_threads | t | |||
) |
Find localization of kre_thread in kre_threads set by pid.
p | Function search t set looking for pid p. | |
t | Set of kre threads. |
struct kre_thread* kre_threads_get_by_id | ( | int | id, | |
kre_threads | t | |||
) | [read] |
Return kre thread by id.
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.
t | Thread to initlize. | |
f | Thread function. | |
data | Pointer to external thread data. NOT WORK AT NOW. |
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.
t | Current thread structure. |
int kre_threads_start | ( | struct kre_thread * | t | ) |
Starting the new thread.
t | Kreporxy thread to start. |
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.
t | kre_thread structure with running task. |