eyBuildLib API Reference : eyBuildLib
ebthread - multi-threads library
ebThreadCreate( ) - create a new thread
ebThreadExit( ) - terminate a thread.
ebThreadWait( ) - waits for thread termination
This library supplys routines for create/terminate multi-threads.
This library support Win32, POSIX OS and VxWorks.
ebthread.h
ebThreadCreate( ) - create a new thread
int ebThreadCreate ( EBTHREAD_ID * ptid, /* to return thread id */ EBTHREAD_ATTR * pattr, /* thread attribute */ EBCALLBACK callback, /* callback routine */ void * arg1, void * arg2, void * arg3, void * arg4, void * arg5 )
This routine is to create a new thread. The ptid is to return thread ID. If pattr is NULL, the default attribute is used, it means user need call ebThreadWait( ) wait for thread termination. if the pattr->attached is set TRUE, user should call ebThreadWait( ) wait for thread termination.
OK, or a non-zero error code.
ebThreadExit( ) - terminate a thread.
void ebThreadExit (void)
This routine is to terminate a thread.
no return value.
ebThreadWait( ) - waits for thread termination
int ebThreadWait ( EBTHREAD_ID * ptid )
This routine waits for thread termination which created by ebThreadCreate( ).
OK, or a non-zero error code.