Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning up .NET 9 locking using source generator. #66

Closed

Conversation

MarkCiliaVincenti
Copy link

No description provided.

Copy link
Member

@ltrzesniewski ltrzesniewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! You've made a really nice library there. 🙂

Unfortunately, I'm not going to merge this, mainly because none of the locks in this project is in the hot path, and I'd like to keep things as simple as possible. To be honest, I'm not even sure using the Lock type is worth releasing a new ZeroLog version.

I'm going to use the global using idea though. I never use global imports so it didn't occur to me they would be perfect in this situation. Would you be interested in contributing this change (a GlobalUsings.cs file in ZeroLog.Impl.Full), even though it wouldn't use your lib?


namespace ZeroLog.Benchmarks.Tools;

public class SerilogTestSink : ILogEventSink
{
private readonly bool _captureLoggedMessages;
private readonly object _lock = new();
private readonly Lock _lock = new();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this!

@ltrzesniewski
Copy link
Member

Fixed with 390af98 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants