- allocate FAST_MUTEX objects from non paged pool.
This should ix a bunch of weird testbot failures.
Any suggestion on the TAG is welcome

svn path=/trunk/; revision=55784
This commit is contained in:
Jérôme Gardou 2012-02-21 18:00:50 +00:00
parent 216a2fef8c
commit e99ab8c0fc
4 changed files with 41 additions and 35 deletions

View file

@ -14,6 +14,7 @@
#define TAG_COLORMAP 'MLOC' /* Color map */
#define TAG_GDIHNDTBLE 'bthG' /* GDI handle table */
#define TAG_DIB ' BID' /* Dib */
#define TAG_INTERNAL_SYNC 'sync' /* Internal synchronization object. Waiting for a better suggestion than 'sync' */
/* GDI objects from the handle table */
#define TAG_DC GDITAG_HMGR_LOOKASIDE_DC_TYPE

View file

@ -115,15 +115,3 @@ DWORD FASTCALL GreGetGlyphIndicesW(HDC,LPWSTR,INT,LPWORD,DWORD,DWORD);
#define IntUnLockProcessPrivateFonts(W32Process) \
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&W32Process->PrivateFontListLock)
#define IntLockGlobalFonts \
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&FontListLock)
#define IntUnLockGlobalFonts \
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&FontListLock)
#define IntLockFreeType \
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&FreeTypeLock)
#define IntUnLockFreeType \
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&FreeTypeLock)

View file

@ -21,7 +21,7 @@ static LONG TimeLast = 0;
/* Windows 2000 has room for 32768 window-less timers */
#define NUM_WINDOW_LESS_TIMERS 32768
static FAST_MUTEX Mutex;
static PFAST_MUTEX Mutex;
static RTL_BITMAP WindowLessTimersBitMap;
static PVOID WindowLessTimersBitMapBuffer;
static ULONG HintIndex = 1;
@ -29,10 +29,10 @@ static ULONG HintIndex = 1;
ERESOURCE TimerLock;
#define IntLockWindowlessTimerBitmap() \
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&Mutex)
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(Mutex)
#define IntUnlockWindowlessTimerBitmap() \
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&Mutex)
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(Mutex)
#define TimerEnterExclusive() \
{ \
@ -585,7 +585,9 @@ InitTimerImpl(VOID)
{
ULONG BitmapBytes;
ExInitializeFastMutex(&Mutex);
/* Allocate FAST_MUTEX from non paged pool */
Mutex = ExAllocatePoolWithTag(NonPagedPool, sizeof(FAST_MUTEX), TAG_INTERNAL_SYNC);
ExInitializeFastMutex(Mutex);
BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) / 8;
WindowLessTimersBitMapBuffer = ExAllocatePoolWithTag(NonPagedPool, BitmapBytes, TAG_TIMERBMP);

View file

@ -32,12 +32,24 @@ typedef struct _FONT_ENTRY
/* The FreeType library is not thread safe, so we have
to serialize access to it */
static FAST_MUTEX FreeTypeLock;
static PFAST_MUTEX FreeTypeLock;
static LIST_ENTRY FontListHead;
static FAST_MUTEX FontListLock;
static PFAST_MUTEX FontListLock;
static BOOL RenderingEnabled = TRUE;
#define IntLockGlobalFonts \
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(FontListLock)
#define IntUnLockGlobalFonts \
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(FontListLock)
#define IntLockFreeType \
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(FreeTypeLock)
#define IntUnLockFreeType \
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(FreeTypeLock)
#define MAX_FONT_CACHE 256
typedef struct _FONT_CACHE_ENTRY
@ -128,8 +140,11 @@ InitFontSupport(VOID)
InitializeListHead(&FontListHead);
InitializeListHead(&FontCacheListHead);
FontCacheNumEntries = 0;
ExInitializeFastMutex(&FontListLock);
ExInitializeFastMutex(&FreeTypeLock);
/* Fast Mutexes must be allocated from non paged pool */
FontListLock = ExAllocatePoolWithTag(NonPagedPool, sizeof(FAST_MUTEX), TAG_INTERNAL_SYNC);
ExInitializeFastMutex(FontListLock);
FreeTypeLock = ExAllocatePoolWithTag(NonPagedPool, sizeof(FAST_MUTEX), TAG_INTERNAL_SYNC);
ExInitializeFastMutex(FreeTypeLock);
ulError = FT_Init_FreeType(&library);
if (ulError)