mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
450f557fee
So far the scheduler priority handling is not POSIX compatible. The priorities use a range of -14 up to +15, which means it's not clear if the POSIX-required return value of -1 in case of an error is *really* an error or just the valid priority value -1. Even more confusing, -14 is the *max* value and 15 is the *min* value. Last but not least this range doesn't match the POSIX requirement of at least 32 priority values. This patch cleans up scheduler priority handling and moves the valid priority range to 1 (min) - 32 (max). It also adds a function sched_get_thread_priority() which will help to make thread priority more POSIX-like. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cygwin documentation is available on the net at http://cygwin.com You might especially be interested in http://cygwin.com/faq/faq.programming.html#faq.programming.building-cygwin