not set thread priority. GetLastError =% d n", GetLastError ()); (hThread1, dwExitCode); ERROR_OCCURED;
}
//
// Create the CPU HOG thread.
// = CreateThread (,,// ​​defaultCycle,// ​​function,// ​​parameters_SUSPENDED,
& threadId
); (hThread2 == NULL)
{("Error: could not create thread. GetLastError =% d n", GetLastError ()); ERROR_OCCURED;
} (! RtSetThreadPriority (hThread2, RT_PRIORITY_MIN))
{("Error: could not set thread priority. GetLastError =% d n", GetLastError ()); (hThread2, dwExitCode); ERROR_OCCURED;
} = RtCreateSemaphore (NULL, 1, 1, MSGSTR_SEM); = RtCreateSemaphore (NULL, 1, 1, MSGSTR_SEM); = RtCreateSemaphore (NULL, 1, 1, MSGSTR_SEM); (mutex == NULL )
{("RtCreateSemaphore failed.");
} (items == NULL)
{("RtCreateSemaphore failed.");
} (spaces == NULL)
{("RtCreateSemaphore failed.");
} (mutex, lReleaseCount, NULL); (
(ResumeThread (hThread1) == RESUME_ERROR)
| |
(ResumeThread (hThread2) == RESUME_ERROR)
)
{("Error: could not resume thread. GetLastError =% d n", GetLastError ()); (hThread1, dwExitCode); (hThread2, dwExitCode); ERROR_OCCURED;
} (150000);
//
// Stop thread. (! TerminateThread (hThread1, dwExitCode) | |! TerminateThread (hThread2, dwExitCode))
{("Error: could not terminate thread. GetLastError =% d n", GetLastError ()); ERROR_OCCURED;
} (mutex); (items); (spaces); (0);
}
# include "RtxApp1.h"
//
// RTX periodic timer handler function
// RTFCNDCL TimerHandler (PVOID context)
{a = (PINT) context;
(* a) + +;
}
////////////////////////////////////////// ////////////////////////
//
// RtxApp1.h - header file
//
////////////////////////////////////////// ////////////////////////
# include
# include
# include
# include
# include
// # include
// # include
// # include
# include ...