src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp
changeset 54663 f03d5a093093
parent 50113 caf115bb98ad
child 55571 49102ba8cf14
child 57360 5d043a159d5c
child 58678 9cf78a70fa4f
equal deleted inserted replaced
54662:afce4a27f2c2 54663:f03d5a093093
     1 /*
     1 /*
     2  * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   134   JfrCheckpointWriter& _writer;
   134   JfrCheckpointWriter& _writer;
   135   int _count;
   135   int _count;
   136  public:
   136  public:
   137   StackTraceWrite(JfrStackTraceRepository& stack_trace_repo, JfrCheckpointWriter& writer) :
   137   StackTraceWrite(JfrStackTraceRepository& stack_trace_repo, JfrCheckpointWriter& writer) :
   138     _stack_trace_repo(stack_trace_repo), _writer(writer), _count(0) {
   138     _stack_trace_repo(stack_trace_repo), _writer(writer), _count(0) {
   139     JfrStacktrace_lock->lock();
   139     JfrStacktrace_lock->lock_without_safepoint_check();
   140   }
   140   }
   141   ~StackTraceWrite() {
   141   ~StackTraceWrite() {
   142     assert(JfrStacktrace_lock->owned_by_self(), "invariant");
   142     assert(JfrStacktrace_lock->owned_by_self(), "invariant");
   143     JfrStacktrace_lock->unlock();
   143     JfrStacktrace_lock->unlock();
   144   }
   144   }