123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- #ifndef __GSL_PTHREAD_H__
- #define __GSL_PTHREAD_H__
- #include "gl_types.h"
- /******************************************************************************/
- /*!
- * @brief Initialize data structures used in GSL Pthread APIs
- *
- * @param void
- *
- * @return @a GL_SUCCESS on success
- * @return @a GL_FAILURE on failure
- *******************************************************************************/
- GL_Status_t GL_PthreadInit(void);
- /******************************************************************************/
- /*!
- * @brief Create a posix thread refering to an attribute data structure
- *
- * @param pHandle Thread object identifier returned by the API (on success)
- * @param pAttr thread attribute
- * @param pEntryPoint Function address from which the task starts executing.
- * @param pTaskArg parameter passed to entry function.
- *
- * @return @a GL_SUCCESS on success
- * @return @a GL_FAILURE on failure
- *
- * @note Cannot be used from ISR/DSR.
- *******************************************************************************/
- GL_Status_t GL_PthreadCreate(GL_Pthread_t *pHandle, GL_PthreadAttr_t pAttr, void *(*pEntryPoint)(void *pArg), void *pTaskArg);
- /******************************************************************************/
- /*!
- * @brief Terminate current task.
- *
- * @param pRet a pointer pointed to a value return to any joined thread
- *
- * @return void
- *
- * @note Cannot be used from ISR/DSR.
- *******************************************************************************/
- void GL_PthreadExit(void *pRet);
- /******************************************************************************/
- /*!
- * @brief Initialize a posix thread attribute data structure
- *
- * @param pAttr posix thread attribute object identifier returned by the API
- *
- * @return @a GL_SUCCESS on success
- * @return @a GL_FAILURE on failure
- *
- * @note
- *******************************************************************************/
- GL_Status_t GL_PthreadAttrInit(GL_PthreadAttr_t *pAttr);
- /******************************************************************************/
- /*!
- * @brief Destroy a posix thread attribute data structure
- *
- * @param pAttr posix thread attribute object identifier returned by the API
- *
- * @return @a GL_SUCCESS on success
- * @return @a GL_FAILURE on failure
- *******************************************************************************/
- GL_Status_t GL_PthreadAttrDestroy(GL_PthreadAttr_t pAttr);
- /******************************************************************************/
- /*!
- * @brief Set inheritance attribute
- *
- * @param pAttr posix thread attribute object identifier returned by the API
- * @param inherit valid values are: GL_PTHREAD_INHERIT_SCHED, GL_PTHREAD_EXPLICIT_SCHED
- *
- * @return @a GL_SUCCESS on success
- * @return @a GL_FAILURE on failure
- *******************************************************************************/
- GL_Status_t GL_PthreadAttrSetinheritsched(GL_PthreadAttr_t pAttr, GL_UINT32 inherit);
- /******************************************************************************/
- /*!
- * @brief Get stack size form a posix thread attribute data structure
- *
- * @param pAttr posix thread attribute object identifier returned by the API
- * @param pSize a container to receive the stack size
- *
- * @return @a GL_SUCCESS on success
- * @return @a GL_FAILURE on failure
- *
- * @note
- *******************************************************************************/
- GL_Status_t GL_PthreadAttrGetStkSize(GL_PthreadAttr_t pAttr, GL_UINT32 *pSize);
- /******************************************************************************/
- /*!
- * @brief Set stack size into a posix thread attribute data structure
- *
- * @param pAttr posix thread attribute object identifier returned by the API
- * @param pSize a container to receive the stack size
- *
- * @return @a GL_SUCCESS on success
- * @return @a GL_FAILURE on failure
- *
- * @note
- *******************************************************************************/
- GL_Status_t GL_PthreadAttrSetStkSize(GL_PthreadAttr_t pAttr, GL_UINT32 dSize);
- #endif // __GSL_PTHREAD_H__
|