Changeset 181257 in webkit
- Timestamp:
- Mar 8, 2015 9:15:42 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r181220 r181257 1 2015-03-08 Brent Fulgham <bfulgham@apple.com> 2 3 [Win] WTF::WorkQueue does not balance ref/deref properly 4 https://bugs.webkit.org/show_bug.cgi?id=142471 5 6 Reviewed by Antti Koivisto. 7 8 Make sure we deref the count when we execute a function in the 9 WorkQueue. 10 11 * wtf/win/WorkQueueWin.cpp: 12 (WTF::WorkQueue::performWorkOnRegisteredWorkThread): 13 1 14 2015-03-07 Brent Fulgham <bfulgham@apple.com> 2 15 -
trunk/Source/WTF/wtf/win/WorkQueueWin.cpp
r181220 r181257 83 83 // Allow more work to be scheduled while we're not using the queue directly. 84 84 m_workItemQueueLock.unlock(); 85 for (auto& workItem : workItemQueue) 85 for (auto& workItem : workItemQueue) { 86 86 workItem->function()(); 87 deref(); 88 } 87 89 m_workItemQueueLock.lock(); 88 90 } -
trunk/Tools/ChangeLog
r181255 r181257 1 2015-03-08 Brent Fulgham <bfulgham@apple.com> 2 3 [Win] WTF::WorkQueue does not balance ref/deref properly 4 https://bugs.webkit.org/show_bug.cgi?id=142471 5 6 Reviewed by Antti Koivisto. 7 8 * TestWebKitAPI/Tests/WTF/WorkQueue.cpp: 9 (TestWebKitAPI::TEST): Check that the refcount is correct. 10 1 11 2015-03-08 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 12 -
trunk/Tools/TestWebKitAPI/Tests/WTF/WorkQueue.cpp
r181254 r181257 54 54 55 55 auto queue = WorkQueue::create("com.apple.WebKit.Test.simple"); 56 56 int initialRefCount = queue->refCount(); 57 EXPECT_EQ(1, initialRefCount); 58 57 59 MutexLocker locker(m_lock); 58 60 queue->dispatch([&](void) { … … 60 62 calledSimpleTest = true; 61 63 }); 62 64 63 65 queue->dispatch([&](void) { 64 66 m_functionCallOrder.append(longTestLabel); … … 79 81 }); 80 82 83 EXPECT_GT(queue->refCount(), 1); 84 81 85 m_testCompleted.wait(m_lock); 86 87 EXPECT_EQ(1, queue->refCount()); 82 88 83 89 EXPECT_TRUE(calledSimpleTest); … … 85 91 EXPECT_TRUE(calledThirdTest); 86 92 87 EXPECT_EQ( m_functionCallOrder.size(), static_cast<size_t>(3));93 EXPECT_EQ(static_cast<size_t>(3), m_functionCallOrder.size()); 88 94 EXPECT_STREQ(simpleTestLabel, m_functionCallOrder[0].c_str()); 89 95 EXPECT_STREQ(longTestLabel, m_functionCallOrder[1].c_str()); … … 104 110 auto queue2 = WorkQueue::create("com.apple.WebKit.Test.twoQueues2"); 105 111 112 int initialQueue1RefCount = queue1->refCount(); 113 int initialQueue2RefCount = queue2->refCount(); 114 EXPECT_EQ(1, initialQueue1RefCount); 115 EXPECT_EQ(1, initialQueue2RefCount); 116 106 117 MutexLocker locker(m_lock); 107 118 … … 133 144 EXPECT_FALSE(calledLongTest); 134 145 EXPECT_TRUE(calledThirdTest); 146 EXPECT_EQ(1, queue1->refCount()); 135 147 136 148 m_testQueue2Completed.wait(m_lock); … … 139 151 EXPECT_TRUE(calledLongTest); 140 152 EXPECT_TRUE(calledThirdTest); 141 142 EXPECT_EQ(m_functionCallOrder.size(), static_cast<size_t>(3)); 153 EXPECT_EQ(1, queue2->refCount()); 154 155 EXPECT_EQ(static_cast<size_t>(3), m_functionCallOrder.size()); 143 156 EXPECT_STREQ(simpleTestLabel, m_functionCallOrder[0].c_str()); 144 157 EXPECT_STREQ(thirdTestLabel, m_functionCallOrder[1].c_str()); … … 183 196 EXPECT_TRUE(calledDispatchAfterTest); 184 197 185 EXPECT_EQ( m_functionCallOrder.size(), static_cast<size_t>(2));198 EXPECT_EQ(static_cast<size_t>(2), m_functionCallOrder.size()); 186 199 EXPECT_STREQ(simpleTestLabel, m_functionCallOrder[0].c_str()); 187 200 EXPECT_STREQ(dispatchAfterLabel, m_functionCallOrder[1].c_str());
Note: See TracChangeset
for help on using the changeset viewer.