Andrew Arnott
d162c02687
Add `JoinableTaskContext.CreateNoOpContext()` method
...
The `JoinableTaskContext` constructor unfortunately has a poor design where folks passing in `null` for the `SynchronizationContext` may mistakenly believe that they're getting a no-op instance when they aren't, if `SynchronizationContext.Current != null`.
In this change, I add a method that *definitely* does what they expect.
I also add an analyzer and a code fix provider to help identify code that was likely written with the incorrect expectation to help them switch to the new method which matches their expectation, or suppress the warning with a more clear syntax.
2024-08-13 10:18:34 -06:00
Andrew Arnott
45895a06a1
Beef up VSTHRD003 documentation
2024-02-20 15:42:51 -07:00
Andrew Arnott
4f0613b131
Update dumpasync.md doc
2024-01-05 15:53:53 -07:00
Andrew Arnott
6af106ecbd
Beef up VSTHRD001 documentation
2023-05-23 10:47:07 -06:00
Andrew Arnott
a390a08ba6
Add documentation on installing and configuring analyzers
...
Closes #1095
2023-05-01 09:32:31 -06:00
Bertan Aygun
4b758e6d0d
Update dumpasync.md
...
Update dumpasync documentation to explain the case where top frame points to an await call with no other frames present.
2023-02-02 15:14:59 -08:00
Andrew Arnott
0847b84735
Provide another example of VSTHRD100 resolution
2022-06-14 13:42:00 -06:00
Asaf Agami
2467f8b2c2
Update VSTHRD100.md
...
There has been previous discussion about whether async void event handlers should raise VSTHRD100 warnings, and the recommended approach in previous issues is to avoid async void for event handlers and use RunAsync instead.
The documentation for VSTHRD100 doesn't address the event handler edge case, and refers to an article that recommends using async void for event handlers. This change addresses it.
This code example has been suggested in this issue:
https://github.com/microsoft/vs-threading/issues/447#issuecomment-481068451
2022-04-11 16:31:42 +03:00
Andrew Arnott
b6cc60dcff
Merge pull request #956 from AArnott/sosThreadingPackage
...
Publish SosThreadingTools with github releases
2021-11-19 11:23:05 -07:00
Andrew Arnott
c46a509404
Publish SosThreadingTools.zip to GitHub releases
2021-11-19 09:26:05 -07:00
Andrew Arnott
0b1e01701a
Update documentation on testing in VS
2021-09-29 08:01:22 -06:00
Luca
1129f0fb6c
dispose the CancellationTokenSource in the code snippet
2021-03-05 19:15:46 -08:00
Andrew Arnott
9a245a3f3c
Fix sample bug
2021-02-09 12:53:58 -07:00
Andrew Arnott
c9e27e6d54
Rename master->main branch
2021-01-27 19:04:49 -07:00
Andrew Arnott
14feb2c802
Merge pull request #706 from nathanrobinson/patch-1
...
Update VSTHRD112.md to call `DisposeAsync` on `System.IAsyncDisposable`
2020-10-29 15:03:40 -06:00
Andrew Arnott
fceb42358b
Fix broken link
2020-10-28 12:09:31 -06:00
nathanrobinson
c57a45b854
Update VSTHRD112.md
...
Shouldn't this call `DisposeAsync` or is there some compiler magic happening?
2020-10-27 08:11:59 -05:00
Andrew Arnott
4de5495c75
Apply latest Library.Template pattern
...
Also enable some analyzers and fix up all the warnings.
2020-09-14 20:43:23 -06:00
Marco Goertz
e4ff743010
Update threading_rules.md
...
Fixed JTF blog link that went nowhere
2020-06-05 08:20:59 -07:00
Andrew Arnott
6aab1a45c9
Document tip about finding a JTF instance
...
Closes #627
2020-05-07 13:13:23 -06:00
Amaury Levé
d3f9efcbae
Fix merge conflicts
2020-04-16 10:50:44 +02:00
Amaury Levé
5b8b2b82f2
Merge branch 'master' into task-return-null
2020-04-16 10:40:03 +02:00
Andrew Arnott
31bf75ec16
Add VSTHRD112 and VSTHRD113 to help folks migrate to System.IAsyncDisposable
...
Closes #583
2020-04-14 15:22:15 -06:00
Amaury Levé
401863104b
Address review comments
2020-04-02 10:12:07 +02:00
Andrew Arnott
475534efaa
Explain another evil of async void
2020-02-24 10:54:09 -07:00
Andrew Arnott
62891022fa
Ensure JTF.SwitchToMainThreadAsync always throws when canceled
...
Even if the caller is on the main thread or reaches the main thread before cancellation from a threadpool thread can be processed, callers tend to expect that the `OperationCanceledException` will be thrown regardless. So this changes behavior to meet expectations.
This also removes the VSTHRD201 analyzer recently added that helped people workaround the fact that this hadn't been the behavior. The analyzer is no longer necessary.
Closes #434
2019-12-20 08:10:22 -07:00
Andrew Arnott
61431ca001
Throw synchronously from STMTA if token is precanceled off the main thread
...
Fixes #569
2019-12-17 17:11:38 -07:00
Andrew Arnott
e49428bfc1
Fine tune based on code review feedback
2019-12-17 16:45:26 -07:00
Andrew Arnott
403d09420a
Merge remote-tracking branch 'upstream/master' into fix435
2019-12-17 13:29:53 -07:00
Andrew Arnott
5788b1aba3
Merge pull request #523 from AArnott/dumpasync
...
Swap out C++ !dumpasync extension for C# version
2019-10-01 19:11:25 -06:00
Andrew Arnott
0cff68347f
Swap out C++ !dumpasync extension for C# version
...
Huge shout out to @lifengl who wrote this. I'm porting it/consolidating it while migrating it to the OSS repo.
2019-10-01 17:03:42 -06:00
Andrew Arnott
f376fa950c
Caveat new technique with internal extension doc
2019-08-22 09:59:18 -06:00
Andrew Arnott
16308ca3e8
Document RPC hang investigation tip
2019-08-22 08:35:43 -06:00
Andrew Arnott
3304714fc9
Add column for default diagnostic severity
2019-07-26 22:24:50 -06:00
Andrew Arnott
9f8ca093c3
Fix code sample to actually compile
2019-05-14 14:28:11 -06:00
Andrew Arnott
4e86edbf9d
Link to windbg
2019-05-10 07:01:54 -07:00
Andrew Arnott
4629359b03
Add link to internal doc
2019-05-08 07:20:03 -07:00
Andrew Arnott
fb641c57d3
Add VSTHRD201 analyzer to cancel after switching to main thread
...
Closes #435
2019-03-22 07:43:29 -07:00
Andrew Arnott
846ff08132
Merge remote-tracking branch 'upstream/v15.8'
2019-01-02 08:29:30 -08:00
Andrew Arnott
3c6183c0c9
Fix bad analyzer ID in docs
2019-01-02 08:28:59 -08:00
Andrew Arnott
fb1444bad2
Mentioned similar CA2008 rule
2018-12-19 11:50:16 -08:00
Andrew Arnott
0250cff66b
Merge branch 'master' into STMTAdoc
2018-12-14 13:34:52 -08:00
Andrew Arnott
2d2acad8be
Document intricacies of JTF.STMTA cancellation behavior
2018-12-14 13:30:14 -08:00
Lifeng Lu
49d4b1c011
Merge remote-tracking branch 'origin/v16.0-preview.1' into master
2018-10-26 17:30:53 -07:00
Andrew Arnott
66a9f8e546
Add threadpool starvation link to Vance Morrison's blog
2018-10-22 09:01:56 -07:00
Andrew Arnott
4b94cfad0b
Suppress VSTHRD105 diagnostic on custom TaskFactory instances
...
Fixes #370
2018-09-23 17:01:55 -07:00
Andrew Arnott
9df4cbf729
Merge remote-tracking branch 'upstream/v15.8'
2018-09-23 14:53:18 -07:00
Andrew Arnott
715ba29b09
Add VSTHRD002 check for ValueTask sync blocking methods
2018-09-22 17:57:54 -07:00
Andrew Arnott
0c866e8700
Merge branch 'v15.8'
2018-09-22 15:20:24 -07:00
Andrew Arnott
c1a4f8c6c2
Add docs for VSTHRD111
2018-09-22 07:12:19 -07:00