Skip to content

Commit a62dafb

Browse files
committed
Use TaskScheduler.Default for manual continuations
This was the remaining work needed to close #17. Closes #17 Closes #19
1 parent 7f03863 commit a62dafb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

AsyncLock/AsyncLock.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ public Task<bool> TryLockAsync(Func<Task> callback, TimeSpan timeout)
395395
}
396396

397397
return true;
398-
});
399-
}).Unwrap();
398+
}, TaskScheduler.Default);
399+
}, TaskScheduler.Default).Unwrap();
400400
}
401401

402402
// Make sure InnerLock.TryLockAsync() does not use await, because an async function triggers a snapshot of
@@ -428,7 +428,7 @@ public Task<bool> TryLockAsync(Action callback, CancellationToken cancel)
428428
disposableLock.Dispose();
429429
}
430430
return true;
431-
});
431+
}, TaskScheduler.Default);
432432
}
433433

434434
// Make sure InnerLock.LockAsync() does not use await, because an async function triggers a snapshot of
@@ -462,8 +462,8 @@ public Task<bool> TryLockAsync(Func<Task> callback, CancellationToken cancel)
462462
}
463463

464464
return true;
465-
});
466-
}).Unwrap();
465+
}, TaskScheduler.Default);
466+
}, TaskScheduler.Default).Unwrap();
467467
}
468468

469469
public IDisposable Lock(CancellationToken cancellationToken = default)

0 commit comments

Comments
 (0)