summaryrefslogtreecommitdiff
path: root/components/cplusplus/Thread.cpp
diff options
context:
space:
mode:
authortyustli <[email protected]>2019-07-27 17:33:36 +0800
committertyustli <[email protected]>2019-07-27 17:33:36 +0800
commit85a9f5add9fd54b3917cfca2a8555c6525df0538 (patch)
tree3f1d642df6ad7a9a158291ef8f5539c0a9374402 /components/cplusplus/Thread.cpp
parent5180262010f5ed76f757125a75d54d37c289d022 (diff)
fix bug in Thread.cpp/Thread.h/components.c files
Diffstat (limited to 'components/cplusplus/Thread.cpp')
-rw-r--r--components/cplusplus/Thread.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/components/cplusplus/Thread.cpp b/components/cplusplus/Thread.cpp
index 9b2a2ad5e0..b21fbdce1f 100644
--- a/components/cplusplus/Thread.cpp
+++ b/components/cplusplus/Thread.cpp
@@ -80,23 +80,23 @@ void Thread::func(Thread *pThis)
}
else
{
- pThis->run();
+ pThis->run(pThis->_param);
}
rt_event_send(&pThis->_event, 1);
}
-void Thread::run()
+void Thread::run(void *parameter)
{
/* please overload this method */
}
-void Thread::wait(int32_t millisec)
+rt_err_t Thread::wait(int32_t millisec)
{
- join(millisec);
+ return join(millisec);
}
-void Thread::join(int32_t millisec)
+rt_err_t Thread::join(int32_t millisec)
{
if (started)
{
@@ -107,6 +107,10 @@ void Thread::join(int32_t millisec)
else
tick = rt_tick_from_millisecond(millisec);
- rt_event_recv(&_event, 1, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, tick, RT_NULL);
+ return rt_event_recv(&_event, 1, RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, tick, RT_NULL);
+ }
+ else
+ {
+ return -RT_ENOSYS;
}
}