diff options
| author | xph <[email protected]> | 2020-04-09 16:35:28 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-04-09 16:35:28 +0800 |
| commit | ca7f01d79b3e0a997c771cec298e4ebd65b75809 (patch) | |
| tree | 3d2c48aae7203b14038ba7b98b500b5343ed7f2a /components/cplusplus/Thread.h | |
| parent | f763f8e7284b0492c5a65ad0abf94ee1963d7dcc (diff) | |
| parent | baa3145bfe61b3330b6a160523cc5470fa5db3a7 (diff) | |
Merge pull request #1 from RT-Thread/master
sync rtt
Diffstat (limited to 'components/cplusplus/Thread.h')
| -rw-r--r-- | components/cplusplus/Thread.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/components/cplusplus/Thread.h b/components/cplusplus/Thread.h index 9b6cf30884..b578659489 100644 --- a/components/cplusplus/Thread.h +++ b/components/cplusplus/Thread.h @@ -20,7 +20,7 @@ namespace rtthread class Thread { public: - typedef void (*thread_func_t) (void *param); + typedef void (*thread_func_t)(void *param); /** Allocate a new thread without starting execution @param priority initial priority of the thread function. (default: osPriorityNormal). @@ -28,14 +28,14 @@ public: @param stack_pointer pointer to the stack area to be used by this thread (default: NULL). */ Thread(rt_uint32_t stack_size = 2048, - rt_uint8_t priority = (RT_THREAD_PRIORITY_MAX * 2)/3, + rt_uint8_t priority = (RT_THREAD_PRIORITY_MAX * 2) / 3, rt_uint32_t tick = 20, const char *name = "th"); Thread(void (*entry)(void *p), void *p = RT_NULL, rt_uint32_t stack_size = 2048, - rt_uint8_t priority = (RT_THREAD_PRIORITY_MAX * 2)/3, + rt_uint8_t priority = (RT_THREAD_PRIORITY_MAX * 2) / 3, rt_uint32_t tick = 20, const char *name = "th"); @@ -45,16 +45,15 @@ public: static void sleep(int32_t millisec); - void wait(int32_t millisec); - void join(int32_t millisec = -1); + rt_err_t wait(int32_t millisec); + rt_err_t join(int32_t millisec = -1); protected: - virtual void run(); + virtual void run(void *parameter); private: static void func(Thread *pThis); -private: rt_thread_t _thread; thread_func_t _entry; |
