support SharedMutex.#1975
Closed
lycplus wants to merge 1 commit into
Closed
Conversation
Contributor
|
related: #1031 |
Contributor
|
CI is failed |
3a2ceb4 to
8f5506d
Compare
Author
|
@wwbmmm I have fixed the build, the CI failure seems unrelated to this patch, please help check it. |
Contributor
|
@guodongxiaren Please help to see this CI failure, the error is so strange. |
Member
Contributor
@liyichao the master branch has fixed the CI issue, please merge master and retry |
Author
|
@wwbmmm I have merged master, the workflows need approval |
wwbmmm
reviewed
Dec 2, 2022
wwbmmm
reviewed
Dec 6, 2022
|
|
||
| static constexpr int32_t max_readers = 1 << 30; | ||
| Mutex _w; | ||
| uint32_t* _writer_butex; |
Contributor
There was a problem hiding this comment.
改成butil::atomic<uint32_t>*,保证操作的内存序
| static constexpr int32_t max_readers = 1 << 30; | ||
| Mutex _w; | ||
| uint32_t* _writer_butex; | ||
| uint32_t* _reader_butex; |
Contributor
|
建议补充单测 |
chenzhangyi
requested changes
Feb 17, 2023
Contributor
|
Closed this as completed in #2752. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
support SharedMutex that is compatible with c++17 std::shared_mutex. This patch uses existing class Mutex, and is migrated from golang, see https://github.com/golang/go/blob/master/src/sync/rwmutex.go