From 406c72ce52ff86d21f11bf0b90c4df6e34dcfb63 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Mon, 12 Jan 2009 17:39:10 +0000 Subject: [PATCH] natUnsafe.cc (spinlock contructor): Call sched_yield(). 2009-01-12 Andrew Haley * sun/misc/natUnsafe.cc (spinlock contructor): Call sched_yield(). From-SVN: r143302 --- libjava/ChangeLog | 4 ++++ libjava/sun/misc/natUnsafe.cc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 72a075da3ee..ebef09f23ef 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,7 @@ +2009-01-12 Andrew Haley + + * sun/misc/natUnsafe.cc (spinlock contructor): Call sched_yield(). + 2009-01-11 Matthias Klose * Makefile.am (ecjx_LDADD): Add $(extra_ldflags). diff --git a/libjava/sun/misc/natUnsafe.cc b/libjava/sun/misc/natUnsafe.cc index cc57dd59889..0bd2d21eac5 100644 --- a/libjava/sun/misc/natUnsafe.cc +++ b/libjava/sun/misc/natUnsafe.cc @@ -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 @@ public: spinlock () { while (! compare_and_swap (&lock, 0, 1)) - ; + _Jv_ThreadYield (); } ~spinlock () {