< prev index next >
src/share/vm/jfr/recorder/storage/jfrBuffer.cpp
Print this page
rev 9053 : 8220293: Deadlock in JFR string pool
Reviewed-by: rehn, egahlin
*** 1,7 ****
/*
! * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 135,144 ****
--- 135,152 ----
void JfrBuffer::clear_identity() {
_identity = NULL;
}
+ bool JfrBuffer::acquired_by(const void* id) const {
+ return identity() == id;
+ }
+
+ bool JfrBuffer::acquired_by_self() const {
+ return acquired_by(Thread::current());
+ }
+
#ifdef ASSERT
static bool validate_to(const JfrBuffer* const to, size_t size) {
assert(to != NULL, "invariant");
if (!JfrRecorder::is_shutting_down()) assert(to->acquired_by_self(), "invariant");
assert(to->free_size() >= size, "invariant");
*** 152,165 ****
static bool validate_this(const JfrBuffer* const t, size_t size) {
assert(t->top() + size <= t->pos(), "invariant");
return true;
}
-
- bool JfrBuffer::acquired_by_self() const {
- return identity() == Thread::current();
- }
#endif // ASSERT
void JfrBuffer::move(JfrBuffer* const to, size_t size) {
assert(validate_to(to, size), "invariant");
assert(validate_this(this, size), "invariant");
--- 160,169 ----
*** 182,192 ****
set_pos(start());
to->release();
set_concurrent_top(start());
}
- // flags
enum FLAG {
RETIRED = 1,
TRANSIENT = 2,
LEASE = 4
};
--- 186,195 ----
< prev index next >