diff options
| author | tyustli <[email protected]> | 2019-06-24 15:59:26 +0800 |
|---|---|---|
| committer | tyustli <[email protected]> | 2019-06-24 15:59:26 +0800 |
| commit | a559179e6fe68a21687e9203ec583bd38b7573e7 (patch) | |
| tree | 40cbba3c161b340c01aa58dbc1ac72fe6aba0552 /components/cplusplus/Thread.cpp | |
| parent | c574c49b2fe81ad2ee6f4ba7f3f61c978bea0497 (diff) | |
fix cpp thread class error
Diffstat (limited to 'components/cplusplus/Thread.cpp')
| -rw-r--r-- | components/cplusplus/Thread.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/cplusplus/Thread.cpp b/components/cplusplus/Thread.cpp index 0f6315d178..103649b639 100644 --- a/components/cplusplus/Thread.cpp +++ b/components/cplusplus/Thread.cpp @@ -14,7 +14,7 @@ Thread::Thread(rt_uint32_t stack_size, rt_uint8_t priority, rt_uint32_t tick, const char *name) -: _entry(RT_NULL), _param(RT_NULL), started(false) + : _entry(RT_NULL), _param(RT_NULL), started(false) { rt_event_init(&_event, name, 0); @@ -32,12 +32,12 @@ Thread::Thread(void (*entry)(void *p), rt_uint8_t priority, rt_uint32_t tick, const char *name) -: _entry(RT_NULL), _param(p), started(false) + : _entry(entry), _param(p), started(false) { rt_event_init(&_event, name, 0); _thread = rt_thread_create(name, - (thread_func_t)func, + (thread_func_t)entry, this, stack_size, priority, @@ -46,6 +46,7 @@ Thread::Thread(void (*entry)(void *p), Thread::~Thread() { + rt_event_detach(&_event); rt_thread_delete(_thread); } |
