Task Scheduler  3d2d7233

Functions

TASH_SCH_EXTERN schThread * schCreateThread (int affinity, schFunc pfunc, void *userData)
 Create new thread object with a custom callback entrypoint. More...
 
TASH_SCH_EXTERN int schDeleteThread (schThread *thread)
 Delete thread This will cause the system to release the thread resources. More...
 
TASH_SCH_EXTERN int schWaitThread (schThread *thread, void **retval)
 
TASH_SCH_EXTERN int schSetThreadName (schThread *thread, const char *name)
 
TASH_SCH_EXTERN schThread * schCurrentThread (void)
 
TASH_SCH_EXTERN int schRaiseThreadSignal (schThread *thread, int signal)
 

Detailed Description

Function Documentation

◆ schCreateThread()

TASH_SCH_EXTERN schThread* schCreateThread ( int  affinity,
schFunc  pfunc,
void *  userData 
)

Create new thread object with a custom callback entrypoint.

Since
0.1.0
Parameters
affinitycore index.
pfuncfunction map to the thread.
userDatauser data associated with the function.
Returns
non-null if successfully. If NULL,

◆ schDeleteThread()

TASH_SCH_EXTERN int schDeleteThread ( schThread *  thread)

Delete thread This will cause the system to release the thread resources.

Since
0.1.0
Parameters
threadvalid thread.
Returns
non-negative if successfully released, otherwise a failure.

◆ schWaitThread()

TASH_SCH_EXTERN int schWaitThread ( schThread *  thread,
void **  retval 
)

Wait in till thread is finished with the callback entry function.

Since
0.1.0
Parameters
threadvalid thread.
retval
Returns
non-negative if successfully.

◆ schSetThreadName()

TASH_SCH_EXTERN int schSetThreadName ( schThread *  thread,
const char *  name 
)

Set thread name.

Since
0.1.0
Parameters
threadvalid thread.
namenon-null terminated string.
Returns
success status.

◆ schCurrentThread()

TASH_SCH_EXTERN schThread* schCurrentThread ( void  )

Get current thread pointer object.

Since
0.1.0
Returns
non-null thread if successfully.

◆ schRaiseThreadSignal()

TASH_SCH_EXTERN int schRaiseThreadSignal ( schThread *  thread,
int  signal 
)

Raise a specific signal to a specified thread.

Since
0.1.0
Parameters
threadvalid thread object.
signalvalid signal.
Returns
non-negative if successfully.