This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Call sched_yield()
- From: Andrew Haley <aph at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Mon, 12 Jan 2009 17:38:32 +0000
- Subject: 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 ()
{