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