mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 11:16:11 +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 ThreadPoolIOWorkerThreadsRequests;
|
||||||
static LONG ThreadPoolIOWorkerThreadsLongRequests;
|
static LONG ThreadPoolIOWorkerThreadsLongRequests;
|
||||||
|
|
||||||
#define IsThreadPoolInitialized() ((volatile LONG)ThreadPoolInitialized == 1)
|
#define IsThreadPoolInitialized() (*((volatile LONG*)&ThreadPoolInitialized) == 1)
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
RtlpInitializeThreadPool(VOID)
|
RtlpInitializeThreadPool(VOID)
|
||||||
|
@ -614,8 +614,8 @@ Wait:
|
||||||
/* FIXME - figure out an effective method to determine if it's appropriate to
|
/* 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
|
lower the number of threads. For now let's always terminate if there's
|
||||||
at least one thread and no queued items. */
|
at least one thread and no queued items. */
|
||||||
Terminate = ((volatile LONG)ThreadPoolIOWorkerThreads - (volatile LONG)ThreadPoolIOWorkerThreadsLongRequests >= WORKERTHREAD_CREATION_THRESHOLD) &&
|
Terminate = (*((volatile LONG*)&ThreadPoolIOWorkerThreads) - *((volatile LONG*)&ThreadPoolIOWorkerThreadsLongRequests) >= WORKERTHREAD_CREATION_THRESHOLD) &&
|
||||||
((volatile LONG)ThreadPoolIOWorkerThreadsRequests == 0);
|
(*((volatile LONG*)&ThreadPoolIOWorkerThreadsRequests) == 0);
|
||||||
|
|
||||||
if (Terminate)
|
if (Terminate)
|
||||||
{
|
{
|
||||||
|
@ -718,7 +718,7 @@ RtlpWorkerThreadProc(IN PVOID Parameter)
|
||||||
{
|
{
|
||||||
/* FIXME - we might want to optimize this */
|
/* FIXME - we might want to optimize this */
|
||||||
if (TimeoutCount++ > 2 &&
|
if (TimeoutCount++ > 2 &&
|
||||||
(volatile LONG)ThreadPoolWorkerThreads - (volatile LONG)ThreadPoolWorkerThreadsLongRequests >= WORKERTHREAD_CREATION_THRESHOLD)
|
*((volatile LONG*)&ThreadPoolWorkerThreads) - *((volatile LONG*)&ThreadPoolWorkerThreadsLongRequests) >= WORKERTHREAD_CREATION_THRESHOLD)
|
||||||
{
|
{
|
||||||
Terminate = TRUE;
|
Terminate = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -819,7 +819,7 @@ RtlQueueWorkItem(IN WORKERCALLBACKFUNC Function,
|
||||||
/* Grow the thread pool */
|
/* Grow the thread pool */
|
||||||
Status = RtlpStartWorkerThread(RtlpIoWorkerThreadProc);
|
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 failed to create the thread, but there's at least one there so
|
||||||
we can at least queue the request */
|
we can at least queue the request */
|
||||||
|
@ -846,7 +846,7 @@ RtlQueueWorkItem(IN WORKERCALLBACKFUNC Function,
|
||||||
/* Grow the thread pool */
|
/* Grow the thread pool */
|
||||||
Status = RtlpStartWorkerThread(RtlpWorkerThreadProc);
|
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 failed to create the thread, but there's at least one there so
|
||||||
we can at least queue the request */
|
we can at least queue the request */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue