GeWuYou b37873a67c feat(concurrency): 添加工业级异步键锁管理器
- 实现了基于键的细粒度异步锁机制
- 提供自动清理未使用锁的功能,避免内存泄漏
- 集成了统计信息收集功能,便于监控和调试
- 支持同步和异步两种锁获取方式
- 实现了锁句柄的自动释放机制
- 添加了完整的单元测试覆盖各种并发场景
2026-03-10 23:11:35 +08:00

30 lines
1014 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright (c) 2025 GeWuYou
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file 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.
namespace GFramework.Core.Abstractions.Concurrency;
/// <summary>
/// 异步锁句柄接口,支持 await using 语法
/// </summary>
public interface IAsyncLockHandle : IAsyncDisposable, IDisposable
{
/// <summary>
/// 锁的键
/// </summary>
string Key { get; }
/// <summary>
/// 锁获取时的时间戳Environment.TickCount64
/// </summary>
long AcquiredTicks { get; }
}