Page MenuHomeFreeBSD

condvar: Add cv_waiters() macro
AbandonedPublic

Authored by christos on Wed, Nov 27, 3:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 6, 3:56 PM
Unknown Object (File)
Wed, Dec 4, 10:26 AM
Unknown Object (File)
Tue, Dec 3, 10:20 PM
Unknown Object (File)
Wed, Nov 27, 3:41 PM
Subscribers

Details

Reviewers
markj
emaste
jhb
Summary

Add an accessor macro for cv_waiters, so that consumers do not access
cv_waiters directly, in similar fashion to cv_wmesg().

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60813
Build 57697: arc lint + arc unit

Event Timeline

As I noted in the email thread, there is only one consumer outside of condvar implementation.

Not sure if it's worthwhile catering to it rather than to fix it.

In D47779#1089550, @avg wrote:

As I noted in the email thread, there is only one consumer outside of condvar implementation.

Not sure if it's worthwhile catering to it rather than to fix it.

Is there a reason (except maybe layering violations) that we do not want to do it this way and it's better to implement an additional counter in the driver?

Also, cv_wmesg is kind of semi-private and it's used only for diagnostics (tracing).
So, I don't think that it's precedent for general access to cv implementation details.

Is there a reason (except maybe layering violations) that we do not want to do it this way and it's better to implement an additional counter in the driver?

Yes, that's the reason.

In D47779#1089555, @avg wrote:

Is there a reason (except maybe layering violations) that we do not want to do it this way and it's better to implement an additional counter in the driver?

Yes, that's the reason.

Alright. There are other places in the sound driver that cv_waiters is still accessed directly, so I will see how I can fix those as well.

Alright. There are other places in the sound driver that cv_waiters is still accessed directly, so I will see how I can fix those as well.

E.g., CHN_BROADCAST can just call cv_broadcastpri.
The pre-check does not really save much.

In D47779#1089559, @avg wrote:

Alright. There are other places in the sound driver that cv_waiters is still accessed directly, so I will see how I can fix those as well.

E.g., CHN_BROADCAST can just call cv_broadcastpri.
The pre-check does not really save much.

I guess the same is true for PCM_RELEASE.

I guess the same is true for PCM_RELEASE.

Looks like there cv_waiters is also used for some diagnostic / tracing.
But perhaps it outlived its usefulness.