• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2019 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package io.perfmark.impl;
18 
19 public abstract class MarkHolderProvider {
20 
MarkHolderProvider()21   protected MarkHolderProvider() {}
22 
23   /**
24    * To be removed in 0.26.0
25    *
26    * @return the new MarkHolder for the current thread.
27    */
28   @Deprecated
create()29   public MarkHolder create() {
30     throw new UnsupportedOperationException();
31   }
32 
33   /**
34    * Creates a new MarkHolder.  Mark holders are always mutated by the thread that created them, (e.g. THIS thread),
35    * but may be read by other threads.
36    *
37    * @param markHolderId the Unique ID associated with the Mark Holder.   This exists as a work around to Java's
38    *                     thread ID, which does not guarantee they will not be reused.
39    * @return the new MarkHolder for the current thread.
40    * @since 0.24.0
41    */
create(long markHolderId)42   public MarkHolder create(long markHolderId) {
43     return create();
44   }
45 }
46