Skip to content

Commit

Permalink
Give eq/hash to SlotPermit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sushisource committed Apr 4, 2024
1 parent 9ae4525 commit 94811fb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
/*
* Copyright (C) 2022 Temporal Technologies, Inc. All Rights Reserved.
*
* Copyright (C) 2012-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Modifications copyright (C) 2017 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this material except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.temporal.internal.activity;

import io.temporal.activity.ActivityInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

package io.temporal.worker.tuning;

import java.util.Objects;
import java.util.concurrent.atomic.AtomicLong;

public class SlotPermit {
Expand All @@ -37,4 +38,17 @@ public SlotPermit(Object userData) {
id = nextId.getAndIncrement();
this.userData = userData;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SlotPermit that = (SlotPermit) o;
return id == that.id;
}

@Override
public int hashCode() {
return Objects.hashCode(id);
}
}

0 comments on commit 94811fb

Please sign in to comment.