apr_status_t stat;
unsigned temp;
HANDLE handle;
+ int priority = THREAD_PRIORITY_NORMAL;
(*new) = (apr_thread_t *)apr_palloc(pool, sizeof(apr_thread_t));
return stat;
}
+ if (attr && attr->priority && attr->priority > 0) {
+ if (attr->priority >= 99) {
+ priority = THREAD_PRIORITY_TIME_CRITICAL;
+ } else if (attr->priority >= 50) {
+ priority = THREAD_PRIORITY_ABOVE_NORMAL;
+ } else if (attr->priority >= 10) {
+ priority = THREAD_PRIORITY_NORMAL;
+ } else if (attr->priority >= 1) {
+ priority = THREAD_PRIORITY_LOWEST;
+ }
+ }
+
/* Use 0 for Thread Stack Size, because that will default the stack to the
* same size as the calling thread.
*/
return apr_get_os_error();
}
#endif
+
+ if (priority) {
+ SetThreadPriority(handle, priority);
+ }
+
if (attr && attr->detach) {
CloseHandle(handle);
}