Changeset 62765 in webkit
- Timestamp:
- Jul 8, 2010 12:38:29 AM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r62764 r62765 1 2010-07-08 Patrick Gansterer <paroga@paroga.com> 2 3 Reviewed by Geoffrey Garen. 4 5 Make FastMalloc more portable. 6 https://bugs.webkit.org/show_bug.cgi?id=41790 7 8 Use WTF::Mutex instead of pthread_mutex_t and 9 replace pthread_cond_t with WTF::ThreadCondition. 10 11 * wtf/FastMalloc.cpp: 12 (WTF::TCMalloc_PageHeap::initializeScavenger): 13 (WTF::TCMalloc_PageHeap::signalScavenger): 14 (WTF::TCMalloc_PageHeap::scavengerThread): 15 1 16 2010-07-08 Patrick Gansterer <paroga@paroga.com> 2 17 -
trunk/JavaScriptCore/wtf/FastMalloc.cpp
r58753 r62765 415 415 #include "TCSpinLock.h" 416 416 #include "TCSystemAlloc.h" 417 #include "Threading.h" 418 #include "ThreadSpecific.h" 417 419 #include <algorithm> 418 420 #include <errno.h> … … 1443 1445 bool m_scavengeThreadActive; 1444 1446 1445 pthread_mutex_tm_scavengeMutex;1446 pthread_cond_tm_scavengeCondition;1447 Mutex m_scavengeMutex; 1448 ThreadCondition m_scavengeCondition; 1447 1449 #else // !HAVE(DISPATCH_H) 1448 1450 void periodicScavenge(); … … 1490 1492 void TCMalloc_PageHeap::initializeScavenger() 1491 1493 { 1492 pthread_mutex_init(&m_scavengeMutex, 0);1493 pthread_cond_init(&m_scavengeCondition, 0);1494 1494 m_scavengeThreadActive = true; 1495 1495 pthread_t thread; … … 1509 1509 { 1510 1510 if (!m_scavengeThreadActive && shouldScavenge()) 1511 pthread_cond_signal(&m_scavengeCondition);1511 m_scavengeCondition.signal(); 1512 1512 } 1513 1513 … … 2375 2375 while (1) { 2376 2376 if (!shouldScavenge()) { 2377 pthread_mutex_lock(&m_scavengeMutex);2377 MutexLocker locker(m_scavengeMutex); 2378 2378 m_scavengeThreadActive = false; 2379 2379 // Block until there are enough free committed pages to release back to the system. 2380 pthread_cond_wait(&m_scavengeCondition, &m_scavengeMutex);2380 m_scavengeCondition.wait(m_scavengeMutex); 2381 2381 m_scavengeThreadActive = true; 2382 pthread_mutex_unlock(&m_scavengeMutex);2383 2382 } 2384 2383 sleep(kScavengeDelayInSeconds);
Note: See TracChangeset
for help on using the changeset viewer.