Comments (6)
What's the target platform for this code?
If you need an immediate solution, you can use SemaphoreSlim
(built-in to newer versions of .NET). The syntax is a bit more awkward but it'll get the job done.
from asyncex.
Thanks for the fast reply :)
Framework is 4.5.1 and platform is x86. I'm awaiting other stuff, which works fine - just for some reason not this one.
I didn't know the SemaphoreSlim could handle the await inside, but I'll check that out, thanks.
from asyncex.
OK, SemaphoreSlim
is available on that platform. It's just a bit more awkward because you have to use try
/finally
instead of using
.
I'll look into this later tonight.
from asyncex.
I just tried the AsyncLock from here instead:
http://blogs.msdn.com/b/pfxteam/archive/2012/02/12/10266988.aspx
I took everything exactly and not changing anything in your example, and it compiled. I'm using your NuGet package by the way - I don't know if that makes any difference. Strange. Anyway - thanks for looking into it :)
from asyncex.
Sorry, I've tried this with a few versions of VS, and I'm not able to repro this behavior.
It's possible that something got messed up during the NuGet install (or something weird happened like it was installed while the project was targeting .NET 4.0). If you could post a minimal repro, I can reopen this issue.
from asyncex.
That's alright, thanks for looking into it. I took your suggestion and used SemaphoreSlim instead, so until I need more complex async handling I'm good :) Thanks again.
from asyncex.
Related Issues (20)
- AsyncCollection IsEmpty HOT 3
- [Discussion] Return `ValueTask` instead of `AwaitableDisposable`? HOT 5
- [Question] .WaitAndUnwrapException() vs AsyncContext and potential deadlock HOT 2
- The collection has been marked as complete with regards to additions HOT 1
- Atomic wait semantics lead to continued processing after cancellation HOT 3
- What happened to NotifyTask? HOT 1
- CancellationTokenTaskSource's dispose
- Using LazyAsync with JSONSeralizer? HOT 1
- Producer/Consumer PriorityQueue
- doc/TaskConstants.md links to an article that doesn't exist anymore
- Cross thread Sync context stealing HOT 2
- [Question] Using discard with AsyncLock HOT 1
- [Question] Is ConfigureAwait(false) is needed? HOT 1
- AsyncContext holds exceptions until all tasks complete.
- Feature request: AsyncReaderWriterLock support for UpgradeableReadLock HOT 11
- The ApmAsyncFactory interop hangs if a path in async method returns synchronously. HOT 1
- Setting AsyncAutoResetEvent after used in Task.WhenAny HOT 3
- AsyncLazy with API call is being called twice across 4 components. HOT 2
- Strong names HOT 6
- Using `AsyncLock` magically causes tasks to complete HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asyncex.