This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Call sched_yield()


This is a patch from a year ago that was never applied.

Andrew.


2009-01-12  Andrew Haley  <aph@redhat.com>

	* sun/misc/natUnsafe.cc (spinlock contructor): Call sched_yield().

Index: sun/misc/natUnsafe.cc
===================================================================
--- sun/misc/natUnsafe.cc	(revision 143294)
+++ sun/misc/natUnsafe.cc	(working copy)
@@ -1,6 +1,6 @@
 // natUnsafe.cc - Implementation of sun.misc.Unsafe native methods.

-/* Copyright (C) 2006
+/* Copyright (C) 2006, 2007
    Free Software Foundation

    This file is part of libgcj.
@@ -32,7 +32,7 @@
 spinlock ()
   {
     while (! compare_and_swap (&lock, 0, 1))
-      ;
+      _Jv_ThreadYield ();
   }
   ~spinlock ()
   {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]