Changeset 62768 in webkit for trunk/JavaScriptCore/wtf/FastMalloc.cpp
- Timestamp:
- Jul 8, 2010, 1:37:06 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/FastMalloc.cpp
r62765 r62768 415 415 #include "TCSpinLock.h" 416 416 #include "TCSystemAlloc.h" 417 #include "Threading.h"418 #include "ThreadSpecific.h"419 417 #include <algorithm> 420 418 #include <errno.h> … … 1445 1443 bool m_scavengeThreadActive; 1446 1444 1447 Mutexm_scavengeMutex;1448 ThreadConditionm_scavengeCondition;1445 pthread_mutex_t m_scavengeMutex; 1446 pthread_cond_t m_scavengeCondition; 1449 1447 #else // !HAVE(DISPATCH_H) 1450 1448 void periodicScavenge(); … … 1492 1490 void TCMalloc_PageHeap::initializeScavenger() 1493 1491 { 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 m_scavengeCondition.signal();1511 pthread_cond_signal(&m_scavengeCondition); 1512 1512 } 1513 1513 … … 2375 2375 while (1) { 2376 2376 if (!shouldScavenge()) { 2377 MutexLocker locker(m_scavengeMutex);2377 pthread_mutex_lock(&m_scavengeMutex); 2378 2378 m_scavengeThreadActive = false; 2379 2379 // Block until there are enough free committed pages to release back to the system. 2380 m_scavengeCondition.wait(m_scavengeMutex);2380 pthread_cond_wait(&m_scavengeCondition, &m_scavengeMutex); 2381 2381 m_scavengeThreadActive = true; 2382 pthread_mutex_unlock(&m_scavengeMutex); 2382 2383 } 2383 2384 sleep(kScavengeDelayInSeconds);
Note:
See TracChangeset
for help on using the changeset viewer.