runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Remove locks from COM events delegate management.

Open AaronRobinsonMSFT opened this issue 3 years ago • 1 comments
trafficstars

This removes locks and instead assumes the collection is immutable.

Fixes #73754

AaronRobinsonMSFT avatar Sep 19 '22 21:09 AaronRobinsonMSFT

/cc @dotnet/interop-contrib

AaronRobinsonMSFT avatar Sep 19 '22 21:09 AaronRobinsonMSFT

@stephentoub The CI is green. Any other thoughts?

AaronRobinsonMSFT avatar Sep 21 '22 12:09 AaronRobinsonMSFT

Use array instead of List<T> Revert "Use array instead of List<T>"

Was there an actual problem or you did not like the result? (It looks better to me with arrays instead of List.)

jkotas avatar Sep 21 '22 13:09 jkotas

Use array instead of List Revert "Use array instead of List"

Was there an actual problem or you did not like the result? (It looks better to me with arrays instead of List.)

It was an option. However, I needed to create a RemoveAll local with annoying logic so deferred to just using List<T>. Either works and appear correct, other than the "Remove" logic you pointed out above. Let me see about simplifying it further.

AaronRobinsonMSFT avatar Sep 21 '22 14:09 AaronRobinsonMSFT

@jkotas @stephentoub I switched back to using arrays, let me know if you prefer List<T>. I also removed the Delegate.Combine logic. My biggest concern with changing that related to threading since this is a COM code path. Looking through it, I no longer have any concerns so it was removed.

AaronRobinsonMSFT avatar Sep 21 '22 15:09 AaronRobinsonMSFT

/backport to release/7.0

AaronRobinsonMSFT avatar Sep 22 '22 19:09 AaronRobinsonMSFT

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3108191020

github-actions[bot] avatar Sep 22 '22 19:09 github-actions[bot]

/backport to release/6.0

AaronRobinsonMSFT avatar Sep 22 '22 19:09 AaronRobinsonMSFT

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/3108193116

github-actions[bot] avatar Sep 22 '22 19:09 github-actions[bot]