ref: d9c90051dc36c9a387a4f9ae8f22e044f7b755db
parent: 234f70988fff844bf64e1242482cf9a7431b8060
parent: fb5e508e64f47d9cc8289277134a302853a58a0f
author: huili2 <[email protected]>
date: Tue Sep 29 16:14:52 EDT 2020
Merge pull request #3343 from mstorsjo/thread-type Use the right thread function signature in WealThreadPoolTest
--- a/test/common/WelsThreadPoolTest.cpp
+++ b/test/common/WelsThreadPoolTest.cpp
@@ -14,7 +14,7 @@
uint32_t CSimpleTask::id = 0;
-void* OneCallingFunc() {
+WELS_THREAD_ROUTINE_TYPE OneCallingFunc(void *) {
CThreadPoolTest cThreadPoolTest;
CSimpleTask* aTasks[TEST_TASK_NUM];
CWelsThreadPool* pThreadPool = (CWelsThreadPool::AddReference());
@@ -44,7 +44,7 @@
TEST (CThreadPoolTest, CThreadPoolTest) {
- OneCallingFunc();
+ OneCallingFunc(NULL);
int iRet = CWelsThreadPool::SetThreadNum (8);
EXPECT_EQ (0, iRet);
@@ -81,12 +81,12 @@
int i = 0;
WELS_THREAD_ERROR_CODE rc;
for (i = 0; i < iCallingNum; i++) {
- rc = WelsThreadCreate (& (mThreadID[i]), (LPWELS_THREAD_ROUTINE)OneCallingFunc, NULL, 0);
+ rc = WelsThreadCreate (& (mThreadID[i]), OneCallingFunc, NULL, 0);
ASSERT_TRUE (rc == WELS_THREAD_ERROR_OK);
WelsSleep (1);
}
for (i = iCallingNum; i < iCallingNum * 2; i++) {
- rc = WelsThreadCreate (& (mThreadID[i]), (LPWELS_THREAD_ROUTINE)OneCallingFunc, NULL, 0);
+ rc = WelsThreadCreate (& (mThreadID[i]), OneCallingFunc, NULL, 0);
ASSERT_TRUE (rc == WELS_THREAD_ERROR_OK);
WelsSleep (1);
WelsThreadJoin (mThreadID[i]);
@@ -95,7 +95,7 @@
WelsThreadJoin (mThreadID[i]);
}
for (i = iCallingNum * 2; i < iCallingNum * 3; i++) {
- rc = WelsThreadCreate (& (mThreadID[i]), (LPWELS_THREAD_ROUTINE)OneCallingFunc, NULL, 0);
+ rc = WelsThreadCreate (& (mThreadID[i]), OneCallingFunc, NULL, 0);
ASSERT_TRUE (rc == WELS_THREAD_ERROR_OK);
WelsSleep (1);
WelsThreadJoin (mThreadID[i]);