This commit is contained in:
Frederic Parain 2014-02-06 14:51:01 -05:00
commit 90b16fd7a9
2 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -373,23 +373,24 @@ ObjectLocker::~ObjectLocker() {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Wait/Notify/NotifyAll // Wait/Notify/NotifyAll
// NOTE: must use heavy weight monitor to handle wait() // NOTE: must use heavy weight monitor to handle wait()
void ObjectSynchronizer::wait(Handle obj, jlong millis, TRAPS) { int ObjectSynchronizer::wait(Handle obj, jlong millis, TRAPS) {
if (UseBiasedLocking) { if (UseBiasedLocking) {
BiasedLocking::revoke_and_rebias(obj, false, THREAD); BiasedLocking::revoke_and_rebias(obj, false, THREAD);
assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now"); assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
} }
if (millis < 0) { if (millis < 0) {
TEVENT (wait - throw IAX) ; TEVENT (wait - throw IAX) ;
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative"); THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative");
} }
ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, obj()); ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, obj());
DTRACE_MONITOR_WAIT_PROBE(monitor, obj(), THREAD, millis); DTRACE_MONITOR_WAIT_PROBE(monitor, obj(), THREAD, millis);
monitor->wait(millis, true, THREAD); monitor->wait(millis, true, THREAD);
/* This dummy call is in place to get around dtrace bug 6254741. Once // This dummy call is in place to get around dtrace bug 6254741. Once
that's fixed we can uncomment the following line and remove the call */ // that's fixed we can uncomment the following line, remove the call
// and change this function back into a "void" func.
// DTRACE_MONITOR_PROBE(waited, monitor, obj(), THREAD); // DTRACE_MONITOR_PROBE(waited, monitor, obj(), THREAD);
dtrace_waited_probe(monitor, obj, THREAD); return dtrace_waited_probe(monitor, obj, THREAD);
} }
void ObjectSynchronizer::waitUninterruptibly (Handle obj, jlong millis, TRAPS) { void ObjectSynchronizer::waitUninterruptibly (Handle obj, jlong millis, TRAPS) {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -68,7 +68,7 @@ class ObjectSynchronizer : AllStatic {
static void jni_exit (oop obj, Thread* THREAD); static void jni_exit (oop obj, Thread* THREAD);
// Handle all interpreter, compiler and jni cases // Handle all interpreter, compiler and jni cases
static void wait (Handle obj, jlong millis, TRAPS); static int wait (Handle obj, jlong millis, TRAPS);
static void notify (Handle obj, TRAPS); static void notify (Handle obj, TRAPS);
static void notifyall (Handle obj, TRAPS); static void notifyall (Handle obj, TRAPS);