More thread return fixes
This commit is contained in:
parent
83e51779ed
commit
17c940423b
@ -69,6 +69,16 @@
|
||||
*/
|
||||
#define DECLARE_THREAD_STACK(name, sz) uint8_t name[sz];
|
||||
|
||||
/*
|
||||
* @brief Return from a thread
|
||||
*
|
||||
* @details Some underlying operating systems allow to return a value from a thread while others don't.
|
||||
* For systems that don't allow to return a value from a thread function this call is simply ignored.
|
||||
*
|
||||
* @param[in] reval The value which should be returned
|
||||
*/
|
||||
#define THREAD_RETURN(retval) return retval
|
||||
|
||||
/**
|
||||
* @name Various platform (and operating system) constants
|
||||
* @note Your platform may use slightly different definitions to these
|
||||
|
@ -63,6 +63,7 @@ typedef portBASE_TYPE threadpriority_t;
|
||||
#define DECLARE_THREAD_STACK(name, sz) size_t *name = (size_t *)sz
|
||||
#define DECLARE_THREAD_FUNCTION(fnName, param) threadreturn_t fnName(void *param)
|
||||
#define THREAD_RETURN(retval)
|
||||
|
||||
portTickType MS2ST(portTickType ms);
|
||||
|
||||
typedef struct {
|
||||
|
@ -27,7 +27,7 @@ typedef pthread_mutex_t gfxMutex;
|
||||
|
||||
#define DECLARE_THREAD_FUNCTION(fnName, param) threadreturn_t fnName(void *param)
|
||||
#define DECLARE_THREAD_STACK(name, sz) uint8_t name[0];
|
||||
#define THREAD_RETURN(retval) return reval
|
||||
#define THREAD_RETURN(retval) return retval
|
||||
|
||||
#define gfxExit() exit(0)
|
||||
#define gfxAlloc(sz) malloc(sz)
|
||||
|
@ -35,8 +35,7 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) {
|
||||
systemticks_t lastTime;
|
||||
GTimerFunction fn;
|
||||
void *param;
|
||||
|
||||
(void)arg;
|
||||
(void) arg;
|
||||
|
||||
nxtTimeout = TIME_INFINITE;
|
||||
lastTime = 0;
|
||||
@ -109,7 +108,7 @@ static DECLARE_THREAD_FUNCTION(GTimerThreadHandler, arg) {
|
||||
lastTime = tm;
|
||||
gfxMutexExit(&mutex);
|
||||
}
|
||||
return 0;
|
||||
THREAD_RETURN(0);
|
||||
}
|
||||
|
||||
void _gtimerInit(void)
|
||||
|
Loading…
Reference in New Issue
Block a user