-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add lock
wrapper for Channels.
#39312
Conversation
Some people on the slack have argued that we should instead remove the I don't mind changing the commit to reflect this, but I would like to know what people think is the better option. |
I don't feel strongly either way. |
Duplicating the code is not good. There are two other methods that use this approach:
That's better since there's no duplication, but in fact we could just remove the More weirdness:
|
I actually missed the fact that |
It looks like we are also missing |
Added lock(f, c::Channel) utility function
Added lock(f, c::Channel) utility function
Added lock(f, c::Channel) utility function
lock(f, lck)
is defined for locks, but not for Channels. I think it's simply a mistake, thus I addedlock(f, ::Channel)
for API uniformity.