/* * Copyright (c) 2012, 2022, 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. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
// // Represents a piece of committed memory. // // Use acquire() and/or try_acquire() for exclusive access // to the buffer (cas identity). This is a precondition // for attempting stores. // // u1* _pos <-- last committed position // u1* _top <-- next unflushed position // // Stores must uphold transactional semantics. This means that _pos // must be updated only after all intended stores have completed already. // The relation between _pos and _top must hold atomically, // e.g. the delta must always be fully parsable. // _top can move concurrently by other threads but is always <= _pos. // // The _flags field holds generic tags applicable to all subsystems. // // The _context field can be used to set subsystem specific tags onto a buffer. // // Memory ordering: // // Method Owner thread Other threads // --------------------------------------------------------------- // acquire() Acquire semantics (cas) Acquire semantics (cas) // try_acquire() Acquire semantics (cas) Acquire semantics (cas) // release() Release semantics Release semantics // pos() Plain load Acquire semantics needed at call sites // set_pos() Release semantics N/A // top() Acquire semantics Acquire semantics // set_top() Release semantics Release semantics // acquire_crit_sec_top() Acquire semantics (cas) Acquire semantics (cas) // release_crit_sec_top() Release semantics Release semantics //
class JfrBuffer { public:
JfrBuffer* _next; // list support private: constvoid* _identity;
u1* _pos; mutableconst u1* _top;
size_t _size;
u2 _header_size;
u1 _flags;
u1 _context;
LP64_ONLY(const u4 _pad;)
// If pos() methods are invoked by a thread that is not the owner, // then acquire semantics must be ensured at the call site. const u1* pos() const { return _pos;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.