mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:15:41 +00:00
[RTL]
Fix useage of volatile in casts. svn path=/trunk/; revision=52246
This commit is contained in:
parent
62a75503e1
commit
e15164f46a
1 changed files with 6 additions and 6 deletions
|
@ -45,7 +45,7 @@ static LONG ThreadPoolIOWorkerThreads;
|
|||
static LONG ThreadPoolIOWorkerThreadsRequests;
|
||||
static LONG ThreadPoolIOWorkerThreadsLongRequests;
|
||||
|
||||
#define IsThreadPoolInitialized() ((volatile LONG)ThreadPoolInitialized == 1)
|
||||
#define IsThreadPoolInitialized() (*((volatile LONG*)&ThreadPoolInitialized) == 1)
|
||||
|
||||
static NTSTATUS
|
||||
RtlpInitializeThreadPool(VOID)
|
||||
|
@ -614,8 +614,8 @@ Wait:
|
|||
/* FIXME - figure out an effective method to determine if it's appropriate to
|
||||
lower the number of threads. For now let's always terminate if there's
|
||||
at least one thread and no queued items. */
|
||||
Terminate = ((volatile LONG)ThreadPoolIOWorkerThreads - (volatile LONG)ThreadPoolIOWorkerThreadsLongRequests >= WORKERTHREAD_CREATION_THRESHOLD) &&
|
||||
((volatile LONG)ThreadPoolIOWorkerThreadsRequests == 0);
|
||||
Terminate = (*((volatile LONG*)&ThreadPoolIOWorkerThreads) - *((volatile LONG*)&ThreadPoolIOWorkerThreadsLongRequests) >= WORKERTHREAD_CREATION_THRESHOLD) &&
|
||||
(*((volatile LONG*)&ThreadPoolIOWorkerThreadsRequests) == 0);
|
||||
|
||||
if (Terminate)
|
||||
{
|
||||
|
@ -718,7 +718,7 @@ RtlpWorkerThreadProc(IN PVOID Parameter)
|
|||
{
|
||||
/* FIXME - we might want to optimize this */
|
||||
if (TimeoutCount++ > 2 &&
|
||||
(volatile LONG)ThreadPoolWorkerThreads - (volatile LONG)ThreadPoolWorkerThreadsLongRequests >= WORKERTHREAD_CREATION_THRESHOLD)
|
||||
*((volatile LONG*)&ThreadPoolWorkerThreads) - *((volatile LONG*)&ThreadPoolWorkerThreadsLongRequests) >= WORKERTHREAD_CREATION_THRESHOLD)
|
||||
{
|
||||
Terminate = TRUE;
|
||||
}
|
||||
|
@ -819,7 +819,7 @@ RtlQueueWorkItem(IN WORKERCALLBACKFUNC Function,
|
|||
/* Grow the thread pool */
|
||||
Status = RtlpStartWorkerThread(RtlpIoWorkerThreadProc);
|
||||
|
||||
if (!NT_SUCCESS(Status) && (volatile LONG)ThreadPoolIOWorkerThreads != 0)
|
||||
if (!NT_SUCCESS(Status) && *((volatile LONG*)&ThreadPoolIOWorkerThreads) != 0)
|
||||
{
|
||||
/* We failed to create the thread, but there's at least one there so
|
||||
we can at least queue the request */
|
||||
|
@ -846,7 +846,7 @@ RtlQueueWorkItem(IN WORKERCALLBACKFUNC Function,
|
|||
/* Grow the thread pool */
|
||||
Status = RtlpStartWorkerThread(RtlpWorkerThreadProc);
|
||||
|
||||
if (!NT_SUCCESS(Status) && (volatile LONG)ThreadPoolWorkerThreads != 0)
|
||||
if (!NT_SUCCESS(Status) && *((volatile LONG*)&ThreadPoolWorkerThreads) != 0)
|
||||
{
|
||||
/* We failed to create the thread, but there's at least one there so
|
||||
we can at least queue the request */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue