{\r
#ifdef WIN32\r
MSG msg;\r
+#endif // WIN32\r
\r
while(taskList.size())\r
{\r
{\r
PROFILE("Kernel task loop");\r
\r
- //DWORD starting_point = GetTickCount();\r
+ DWORD starting_point = GetTickCount();\r
\r
+#ifdef WIN32\r
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))\r
{\r
TranslateMessage(&msg);\r
DispatchMessage(&msg);\r
}\r
+#endif // WIN32\r
\r
\r
std::list< CMMPointer<ITask> >::iterator it, thisIt;\r
}\r
}\r
IMMObject::CollectGarbage();\r
- //DWORD end_point = GetTickCount();\r
-// Sleep(50 - (end_point-starting_point));\r
+ DWORD end_point = GetTickCount();\r
+ /* Sleep if we didn't use up too much time already */\r
+ if (starting_point + 50 > end_point)\r
+ Sleep(50 - (end_point-starting_point));\r
}\r
#ifdef _DEBUG\r
CProfileSample::Output();\r
#endif\r
}\r
-#endif // WIN32\r
\r
return 0;\r
}\r