OSDN Git Service

* thread.cc (pthread_setschedprio): New function.
authoryselkowitz <yselkowitz>
Fri, 15 Apr 2011 09:22:13 +0000 (09:22 +0000)
committeryselkowitz <yselkowitz>
Fri, 15 Apr 2011 09:22:13 +0000 (09:22 +0000)
* include/pthread.h (pthread_setschedprio): Declare.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* cygwin.din (pthread_setschedprio): Export.
* posix.sgml (std-notimpl) Move pthread_setschedprio from here...
(std-susv4) ...to here.

winsup/cygwin/ChangeLog
winsup/cygwin/cygwin.din
winsup/cygwin/include/cygwin/version.h
winsup/cygwin/include/pthread.h
winsup/cygwin/posix.sgml
winsup/cygwin/thread.cc

index 7c71566..4caa5b8 100644 (file)
@@ -1,3 +1,12 @@
+2011-04-15  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
+
+       * thread.cc (pthread_setschedprio): New function.
+       * include/pthread.h (pthread_setschedprio): Declare.
+       * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
+       * cygwin.din (pthread_setschedprio): Export.
+       * posix.sgml (std-notimpl) Move pthread_setschedprio from here...
+       (std-susv4) ...to here.
+
 2011-04-10  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>
 
        * fhandler_proc.cc (proc_tab): Add /proc/swaps virtual file.
index 10565ad..d5edb20 100644 (file)
@@ -1241,6 +1241,7 @@ pthread_setcancelstate SIGFE
 pthread_setcanceltype SIGFE
 pthread_setconcurrency SIGFE
 pthread_setschedparam SIGFE
+pthread_setschedprio SIGFE
 pthread_setspecific SIGFE
 pthread_sigmask SIGFE
 pthread_suspend SIGFE
index 58c55f6..072f62d 100644 (file)
@@ -403,12 +403,13 @@ details. */
       237: Export strchrnul.
       238: Export pthread_spin_destroy, pthread_spin_init, pthread_spin_lock,
           pthread_spin_trylock, pthread_spin_unlock.
+      239: Export pthread_setschedprio.
      */
 
      /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
 
 #define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 238
+#define CYGWIN_VERSION_API_MINOR 239
 
      /* There is also a compatibity version number associated with the
        shared memory regions.  It is incremented when incompatible
index 10a53f3..221d242 100644 (file)
@@ -194,6 +194,7 @@ pthread_t pthread_self (void);
 int pthread_setcancelstate (int, int *);
 int pthread_setcanceltype (int, int *);
 int pthread_setschedparam (pthread_t, int, const struct sched_param *);
+int pthread_setschedprio (pthread_t, int);
 int pthread_setspecific (pthread_key_t, const void *);
 void pthread_testcancel (void);
 
index 53e7606..d44f2bf 100644 (file)
@@ -598,6 +598,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
     pthread_setcanceltype
     pthread_setconcurrency
     pthread_setschedparam
+    pthread_setschedprio
     pthread_setspecific
     pthread_sigmask
     pthread_spin_destroy
@@ -1388,7 +1389,6 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
     pthread_mutex_timedlock
     pthread_rwlock_timedrdlock
     pthread_rwlock_timedwrlock
-    pthread_setschedprio
     putmsg
     reminderl
     remquol
index 29674d4..87167b7 100644 (file)
@@ -2306,6 +2306,17 @@ pthread_setschedparam (pthread_t thread, int policy,
   return rv;
 }
 
+extern "C" int
+pthread_setschedprio (pthread_t thread, int priority)
+{
+  if (!pthread::is_good_object (&thread))
+    return ESRCH;
+  int rv =
+    sched_set_thread_priority (thread->win32_obj_id, priority);
+  if (!rv)
+    thread->attr.schedparam.sched_priority = priority;
+  return rv;
+}
 
 extern "C" int
 pthread_setspecific (pthread_key_t key, const void *value)