[kaffe] CVS kaffe (dalibor): Check for missing pthread_attr_setschedpolicy

Kaffe CVS cvs-commits at kaffe.org
Sun Jul 11 13:23:48 PDT 2004


PatchSet 4932 
Date: 2004/07/11 20:15:26
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Check for missing pthread_attr_setschedpolicy

2004-07-11  Dalibor Topic  <robilad at kaffe.org>,

        * configure.ac:
        Added check for pthread_attr_setschedpolicy.

        * kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:
        Only use pthread_attr_setschedpolicy if it exists on
        the system.

        * configure,
        config/config.h.in:
        Regenerated.

        Reported by: Riccardo Mottola  <zuse at libero.it>

Members: 
	ChangeLog:1.2497->1.2498 
	configure:1.351->1.352 
	configure.ac:1.49->1.50 
	config/config.h.in:1.115->1.116 
	kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.31->1.32 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2497 kaffe/ChangeLog:1.2498
--- kaffe/ChangeLog:1.2497	Sun Jul 11 19:03:01 2004
+++ kaffe/ChangeLog	Sun Jul 11 20:15:26 2004
@@ -1,4 +1,19 @@
 2004-07-11  Dalibor Topic  <robilad at kaffe.org>,
+
+        * configure.ac:
+	Added check for pthread_attr_setschedpolicy.
+
+        * kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:
+	Only use pthread_attr_setschedpolicy if it exists on
+	the system.
+
+        * configure,
+        config/config.h.in:
+	Regenerated.
+
+	Reported by: Riccardo Mottola  <zuse at libero.it>
+
+2004-07-11  Dalibor Topic  <robilad at kaffe.org>,
 	    Helmer Kraemer  <hkraemer at freenet.de>
 
         * kaffe/kaffevm/jit3/funcs.h:
Index: kaffe/configure
diff -u kaffe/configure:1.351 kaffe/configure:1.352
--- kaffe/configure:1.351	Sun Jul 11 08:54:17 2004
+++ kaffe/configure	Sun Jul 11 20:15:27 2004
@@ -47754,6 +47754,110 @@
 done
 
 
+# pthread_attr_setschedpolicy in not implemented on NetBSD <= 1.6
+
+for ac_func in pthread_attr_setschedpolicy
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
 
 for ac_func in getifaddrs
 do
Index: kaffe/configure.ac
diff -u kaffe/configure.ac:1.49 kaffe/configure.ac:1.50
--- kaffe/configure.ac:1.49	Sun Jul 11 08:54:27 2004
+++ kaffe/configure.ac	Sun Jul 11 20:15:33 2004
@@ -1256,6 +1256,9 @@
 AC_CHECK_FUNCS([sched_get_priority_max])
 AC_CHECK_FUNCS([sched_get_priority_min])
 
+# pthread_attr_setschedpolicy in not implemented on NetBSD <= 1.6
+AC_CHECK_FUNCS([pthread_attr_setschedpolicy])
+
 dnl getifaddrs replacement for linux
 AC_REPLACE_FUNCS([getifaddrs])
 AC_CHECK_HEADERS(ifaddrs.h,use_compat_ifaddrs="no",use_compat_ifaddrs="yes")
Index: kaffe/config/config.h.in
diff -u kaffe/config/config.h.in:1.115 kaffe/config/config.h.in:1.116
--- kaffe/config/config.h.in:1.115	Sun Jul 11 08:54:29 2004
+++ kaffe/config/config.h.in	Sun Jul 11 20:15:35 2004
@@ -398,6 +398,9 @@
 /* Define if you have POSIX threads libraries and header files. */
 #undef HAVE_PTHREAD
 
+/* Define to 1 if you have the `pthread_attr_setschedpolicy' function. */
+#undef HAVE_PTHREAD_ATTR_SETSCHEDPOLICY
+
 /* Define to 1 if you have the <pthread.h> header file. */
 #undef HAVE_PTHREAD_H
 
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.31 kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.32
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.31	Sun Jul 11 08:54:44 2004
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c	Sun Jul 11 20:15:36 2004
@@ -736,7 +736,9 @@
 
 	pthread_attr_init( &nt->attr);
 	pthread_attr_setschedparam( &nt->attr, &sp);
+#if defined(HAVE_PTHREAD_ATTR_SETSCHEDPOLICY)
 	pthread_attr_setschedpolicy( &nt->attr, SCHEDULE_POLICY);
+#endif /* defined(HAVE_PTHREAD_ATTR_SETSCHEDPOLICY) */
 	pthread_attr_setstacksize( &nt->attr, threadStackSize);
 
 	nt->data.jlThread       = jlThread;




More information about the kaffe mailing list