mirror of https://github.com/abpframework/abp.git
3 changed files with 21 additions and 12 deletions
@ -1,20 +1,20 @@ |
|||||
using System.Threading; |
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
|
||||
namespace Volo.Abp.DistributedLocking; |
namespace Volo.Abp.DistributedLocking; |
||||
|
|
||||
public class LocalAbpDistributedLockHandle : IAbpDistributedLockHandle |
public class LocalAbpDistributedLockHandle : IAbpDistributedLockHandle |
||||
{ |
{ |
||||
private readonly SemaphoreSlim _semaphore; |
private readonly IDisposable _disposable; |
||||
|
|
||||
public LocalAbpDistributedLockHandle(SemaphoreSlim semaphore) |
public LocalAbpDistributedLockHandle(IDisposable disposable) |
||||
{ |
{ |
||||
_semaphore = semaphore; |
_disposable = disposable; |
||||
} |
} |
||||
|
|
||||
public ValueTask DisposeAsync() |
public ValueTask DisposeAsync() |
||||
{ |
{ |
||||
_semaphore.Release(); |
_disposable.Dispose(); |
||||
return default; |
return default; |
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue