mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
added mutex tests
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@2881 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
@@ -433,6 +433,20 @@ static VOID PhpTestRwLock(
|
||||
wprintf(L"[strs] %s: %ums\n", Context->Name, PhGetMillisecondsStopwatch(&stopwatch));
|
||||
}
|
||||
|
||||
VOID FASTCALL PhfAcquireMutex(
|
||||
__in PPH_MUTEX Mutex
|
||||
)
|
||||
{
|
||||
PhAcquireMutex(Mutex);
|
||||
}
|
||||
|
||||
VOID FASTCALL PhfReleaseMutex(
|
||||
__in PPH_MUTEX Mutex
|
||||
)
|
||||
{
|
||||
PhReleaseMutex(Mutex);
|
||||
}
|
||||
|
||||
NTSTATUS PhpDebugConsoleThreadStart(
|
||||
__in PVOID Parameter
|
||||
)
|
||||
@@ -579,6 +593,7 @@ NTSTATUS PhpDebugConsoleThreadStart(
|
||||
RW_TEST_CONTEXT context;
|
||||
PH_FAST_LOCK fastLock;
|
||||
PH_QUEUED_LOCK queuedLock;
|
||||
PH_MUTEX mutex;
|
||||
|
||||
context.Name = L"FastLock";
|
||||
context.AcquireExclusive = PhfAcquireFastLockExclusive;
|
||||
@@ -598,6 +613,25 @@ NTSTATUS PhpDebugConsoleThreadStart(
|
||||
context.Parameter = &queuedLock;
|
||||
PhInitializeQueuedLock(&queuedLock);
|
||||
PhpTestRwLock(&context);
|
||||
|
||||
context.Name = L"Mutex";
|
||||
context.AcquireExclusive = PhfAcquireMutex;
|
||||
context.AcquireShared = PhfAcquireMutex;
|
||||
context.ReleaseExclusive = PhfReleaseMutex;
|
||||
context.ReleaseShared = PhfReleaseMutex;
|
||||
context.Parameter = &mutex;
|
||||
PhInitializeMutex(&mutex);
|
||||
PhpTestRwLock(&context);
|
||||
PhDeleteMutex(&mutex);
|
||||
|
||||
context.Name = L"QueuedLockMutex";
|
||||
context.AcquireExclusive = PhfAcquireQueuedLockExclusive;
|
||||
context.AcquireShared = PhfAcquireQueuedLockExclusive;
|
||||
context.ReleaseExclusive = PhfReleaseQueuedLockExclusive;
|
||||
context.ReleaseShared = PhfReleaseQueuedLockExclusive;
|
||||
context.Parameter = &queuedLock;
|
||||
PhInitializeQueuedLock(&queuedLock);
|
||||
PhpTestRwLock(&context);
|
||||
}
|
||||
else if (WSTR_IEQUAL(command, L"objects"))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user