Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

KThread.h File Reference

Thread management. More...

#include "ktypes.h"

Defines

#define KThread_create(run_function, datas, name)   _KThread_create(run_function, datas, name, __K_FILE__, __K_LINE__)
 Creates a thread.
#define KThread_destroy(kThread)   _KThread_destroy (kThread, __K_FILE__, __K_LINE__)
 Deletes a thread and stops if it is in execution state.
#define KThread_kill(kThread)   _KThread_kill (kThread, __K_FILE__, __K_LINE__)
 Kills the thread.
#define KThread_wait(kThread, ret)   _KThread_wait (kThread, ret, __K_FILE__, __K_LINE__)
 Waits the end of the thread execution.

Typedefs

typedef _KThread KThread
 Thread.
typedef KIntKThread_Function )(KPtr)
 functions called by threads

Functions

KTL_API KThread_KThread_create (KThread_Function *run_function, KPtr datas, KString name, KString sFile, KInt32 iLine)
 Creates a thread.
KTL_API KBool KThread_setStopFunc (KThread *kThread, KThread_Stop_Function *stop_function)
 ??
KTL_API KBool KThread_stop (KThread *kThread)
 Stops the execution of a thread.
KTL_API KBool KThread_start (KThread *kThread)
 Starts the execution of a thread.
KTL_API void _KThread_destroy (KThread **kThread, KString file, KInt line)
 Deletes a thread and stops if it is in execution state.
KTL_API KBool _KThread_kill (KThread *kThread, KString file, KInt line)
 Kills the thread.
KTL_API KBool _KThread_wait (KThread *kThread, KInt *n, KString file, KInt line)
 Waits the end of the thread execution.
KTL_API KBool KThread_isStarted (KThread *kThread)
 Indicates if a thread is launched. The thread can be in an execution state, blocked or ended.
KTL_API KString KThread_GetCurrentThreadName ()
 Gets the current name of a thread.
KTL_API KInt KThread_GetCurrentThreadId ()
 Gets the ID of a thread.
KTL_API KBool KThread_initControl ()
 Initializes the control for a thread.
KTL_API KBool KThread_closeControl ()
 Closes the control for a thread.
KTL_API KBool KThread_setPriority (KThread *kThread, KInt iPriority)
 Changes a thread priority.


Detailed Description

Thread management.

Version:
KToolLib-1.0
Author:
Fabien Gallot
Date:
05/08/2008
Note:
Copyright © 2008-2010 iKlax Media SAS (www.iklaxmedia.com). All rights reserved.

Define Documentation

#define KThread_create run_function,
datas,
name   )     _KThread_create(run_function, datas, name, __K_FILE__, __K_LINE__)
 

Creates a thread.

Parameters:
run_function the function to compute by a thread
datas the function parameters
name the name of the thread
Returns:
the pointer to the created thread

#define KThread_destroy kThread   )     _KThread_destroy (kThread, __K_FILE__, __K_LINE__)
 

Deletes a thread and stops if it is in execution state.

Parameters:
kThread the pointer to the deleted thread

#define KThread_kill kThread   )     _KThread_kill (kThread, __K_FILE__, __K_LINE__)
 

Kills the thread.

Parameters:
kThread the pointer to the thread to be killed
Returns:
ktrue if successful otherwise kfalse

#define KThread_wait kThread,
ret   )     _KThread_wait (kThread, ret, __K_FILE__, __K_LINE__)
 

Waits the end of the thread execution.

Parameters:
kThread the pointer to the thread
ret the pointer to an integral number
Returns:
ktrue if successful otherwise kfalse


Function Documentation

KTL_API KThread* _KThread_create KThread_Function run_function,
KPtr  datas,
KString  name,
KString  sFile,
KInt32  iLine
 

Creates a thread.

Parameters:
run_function the function to compute by a thread
datas the function parameters
name the name of the thread
sFile the file name where this function is called
iLine the line number where thisq function is called
Returns:
the pointer to the created thread

KTL_API void _KThread_destroy KThread **  kThread,
KString  file,
KInt  line
 

Deletes a thread and stops if it is in execution state.

Parameters:
kThread the pointer to the deleted thread
file the file name where this function is called
line the line number where this function is called

KTL_API KBool _KThread_kill KThread kThread,
KString  file,
KInt  line
 

Kills the thread.

Parameters:
kThread the pointer to the thread to be killed
file the file name where this function is called
line the line number where this function is called
Returns:
ktrue if successful otherwise kfalse

KTL_API KBool _KThread_wait KThread kThread,
KInt n,
KString  file,
KInt  line
 

Waits the end of the thread execution.

Parameters:
kThread the pointer to the thread
n the pointer to an integral number
file the file name where this function is called
line the line number where this function is called
Returns:
ktrue if successful otherwise kfalse

KTL_API KBool KThread_closeControl  ) 
 

Closes the control for a thread.

Returns:
ktrue if successful otherwise kfalse

KTL_API KInt KThread_GetCurrentThreadId  ) 
 

Gets the ID of a thread.

Returns:
an integral number which represents the thread ID

KTL_API KString KThread_GetCurrentThreadName  ) 
 

Gets the current name of a thread.

Returns:
the string which represents the thread name

KTL_API KBool KThread_initControl  ) 
 

Initializes the control for a thread.

Returns:
ktrue if successful otherwise kfalse

KTL_API KBool KThread_isStarted KThread kThread  ) 
 

Indicates if a thread is launched. The thread can be in an execution state, blocked or ended.

Parameters:
kThread the pointer to the thread
Returns:
ktrue if the thread is in an execution state or blocked otherwise kfalse

KTL_API KBool KThread_setPriority KThread kThread,
KInt  iPriority
 

Changes a thread priority.

Parameters:
kThread the pointer to the thread
iPriority an integer value between 0 (the lowest priority) and 10 (the highest priority)
Returns:
ktrue if successful otherwise kfalse

KTL_API KBool KThread_setStopFunc KThread kThread,
KThread_Stop_Function *  stop_function
 

??

Parameters:
kThread the pointer to the thread... ??
stop_function ??
Returns:
??

KTL_API KBool KThread_start KThread kThread  ) 
 

Starts the execution of a thread.

Parameters:
kThread the pointer to the thread to be executed
Returns:
ktrue if successful otherwise kfalse

KTL_API KBool KThread_stop KThread kThread  ) 
 

Stops the execution of a thread.

Parameters:
kThread the pointer to the thread to be stopped
Returns:
ktrue if successful otherwise kfalse


Generated on Tue Mar 9 10:49:30 2010 for iKlax Tools Library (KToolLib) by doxygen 1.3.8