Pedro Alves wrote:
> pgeorges wrote:
>
> At http://msdn2.microsoft.com/en-us/library/ms913056.aspx
> it is stated that
> "All threads initially start at THREAD_PRIORITY_NORMAL (251)."
>
> Currently I use
> CeSetThreadPriority(GetCurrentThread(), priority);
> where priority is between 248 and 254 to run threads in background.
>
> If I remember well, this priority value has changed between WinCE versions.
> So I hope everything is ok with this patch.
>
> Hummm, it isn't clear if one should *always* use the 248-254
> range in both SetThreadPriority and CeSetThreadPriority, or if
> just on the Ce* functions.
>
> I assumed that the GetThreadPriority still returned the
> same values as CE 2 did. That'll have to be checked
> with a simple GetThreadPriority on GetCurrentThread, to see if it
> returns a value in the range of 248-255 as said here:
> http://msdn2.microsoft.com/en-us/library/aa450596.aspx
>
> ... or a value in the 0-8 range.
>
> We may have to conditionalise those values with _WIN32_WCE > 2, etc...
>
Well, someone should send MSFT a doc patch :)
this:
#include <windows.h>
#include <stdio.h>
int main ()
{
HANDLE h = GetCurrentThread ();
int prio = GetThreadPriority (h);
int prio2 = CeGetThreadPriority (h);
int error = CeGetThreadPriority ((HANDLE)123);
printf ("prio = %d\n", prio);
printf ("prio2 = %d\n", prio2);
printf ("error = %x\n", error);
return 0;
}
... prints:
prio = 3
prio2 = 251
error = 0x7fffffff
(I was also curious to see if we already have
THREAD_PRIORITY_ERROR_RETURN right -- we do)
I've checked Matt's patch in.
Cheers,
Pedro Alves
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Cegcc-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cegcc-devel