History

remove sink in WelsThreadPool and hide the construtor to finish the singleTon

sijchen committed 10 years ago

Commit 4db9c321 parent d4f09d97 files · +28 −54Browse files

Showing the changes to test/common/WelsThreadPoolTest.cpp (1 of 7 files). Show all

Unified · Split

test/common/WelsThreadPoolTest.cpp+5−3
@@ -39,7 +39,7 @@ uint32_t CSimpleTask::id = 0; · 38 unmodified lines
3939 void* OneCallingFunc() {
4040 CThreadPoolTest cThreadPoolTest;
4141 CSimpleTask* aTasks[TEST_TASK_NUM];
42− CWelsThreadPool* pThreadPool = & (CWelsThreadPool::AddReference (&cThreadPoolTest));
42+ CWelsThreadPool* pThreadPool = & (CWelsThreadPool::AddReference());
4343
4444 int32_t i;
4545 for (i = 0; i < TEST_TASK_NUM; i++) {
@@ -70,8 +70,9 @@ TEST (CThreadPoolTest, CThreadPoolTest) { · 24 unmodified lines
7070 EXPECT_EQ (0, iRet);
7171 EXPECT_FALSE (CWelsThreadPool::IsReferenced());
7272
73− CWelsThreadPool* pThreadPool = & (CWelsThreadPool::AddReference (NULL));
73+ CWelsThreadPool* pThreadPool = & (CWelsThreadPool::AddReference ());
7474 EXPECT_TRUE(pThreadPool->IsReferenced());
75+
7576 EXPECT_EQ (8, pThreadPool->GetThreadNum());
7677
7778 iRet = CWelsThreadPool::SetThreadNum (4);
@@ -82,7 +83,8 @@ TEST (CThreadPoolTest, CThreadPoolTest) { · 4 unmodified lines
8283
8384 iRet = CWelsThreadPool::SetThreadNum (4);
8485 EXPECT_EQ (0, iRet);
85− pThreadPool = & (CWelsThreadPool::AddReference (NULL));
86+
87+ pThreadPool = & (CWelsThreadPool::AddReference ());
8688 EXPECT_TRUE (pThreadPool->IsReferenced());
8789 EXPECT_EQ (4, pThreadPool->GetThreadNum());
8890 pThreadPool->RemoveInstance();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t