Skip to content

Fix misleading doc comment in ReaderWriterLatch#879

Open
Chessing234 wants to merge 1 commit intocmu-db:masterfrom
Chessing234:fix/rwlatch-doc-comment
Open

Fix misleading doc comment in ReaderWriterLatch#879
Chessing234 wants to merge 1 commit intocmu-db:masterfrom
Chessing234:fix/rwlatch-doc-comment

Conversation

@Chessing234
Copy link
Copy Markdown

Summary

  • The class-level documentation for ReaderWriterLatch in rwlatch.h states it is "backed by std::mutex", but the actual underlying member is std::shared_mutex.
  • This is misleading because std::mutex does not support shared/reader locking, while std::shared_mutex does -- which is the whole point of the class.
  • Updated the comment to correctly say "backed by std::shared_mutex".

Test plan

  • No behavioral change; documentation-only fix.
  • Verified the comment now matches the actual member type (std::shared_mutex mutex_).

The class documentation for `ReaderWriterLatch` says it is "backed by
std::mutex", but the underlying member is actually a `std::shared_mutex`.
This is misleading since `std::mutex` does not support shared (reader)
locking. Correct the comment to reference `std::shared_mutex`.

Signed-off-by: Chessing234 <Chessing234@users.noreply.github.com>
Signed-off-by: Taksh <takshkothari09@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant