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; |
using System.Threading.Tasks; |
||||
|
|
||||
namespace Volo.Abp.DistributedLocking; |
namespace Volo.Abp.DistributedLocking |
||||
|
|
||||
public class LocalAbpDistributedLockHandle : IAbpDistributedLockHandle |
|
||||
{ |
{ |
||||
private readonly IDisposable _disposable; |
public class LocalAbpDistributedLockHandle : IAbpDistributedLockHandle |
||||
|
|
||||
public LocalAbpDistributedLockHandle(IDisposable disposable) |
|
||||
{ |
{ |
||||
_disposable = disposable; |
private readonly SemaphoreSlim _semaphore; |
||||
} |
|
||||
|
|
||||
public ValueTask DisposeAsync() |
public LocalAbpDistributedLockHandle(SemaphoreSlim semaphore) |
||||
{ |
{ |
||||
_disposable.Dispose(); |
_semaphore = semaphore; |
||||
return default; |
} |
||||
|
|
||||
|
public ValueTask DisposeAsync() |
||||
|
{ |
||||
|
_semaphore.Release(); |
||||
|
return default; |
||||
|
} |
||||
} |
} |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue