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

Add SAL annotations to shared_mutex. #3536

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0a2100a
Add SAL annotations to shared_mutex.
NN--- Mar 4, 2023
c594e8c
Add SAL to StatementMacros list for correct document formatting.
NN--- Mar 4, 2023
23188a4
Fix compilation using correct place for SAL.
NN--- Mar 5, 2023
d6c1079
Format document
NN--- Mar 5, 2023
02367a0
Update code formatting
NN--- Mar 5, 2023
3a4a72f
Update code formatting
NN--- Mar 5, 2023
33108e2
Add _NODISCARD_CTOR_LOCK to statement macro.
NN--- Mar 5, 2023
8ed4013
Add precondition annotations
NN--- Mar 5, 2023
ac2994e
Suppress bad compiler warning
NN--- Mar 7, 2023
f23aeb1
Add annotations for swap, move and detach locks.
NN--- Mar 7, 2023
3a0f89c
Reformat files
NN--- Mar 7, 2023
bd204cd
Format files
NN--- Mar 7, 2023
ab0e8d4
Fix formattting.
NN--- Mar 7, 2023
2039fa3
Fix annotations.
NN--- Mar 9, 2023
0f51d6b
Improve constructor annotations.
NN--- Mar 14, 2023
4a179e8
Improve constructor annotations.
NN--- Mar 14, 2023
6a586e5
Update .clang-format
NN--- Mar 14, 2023
dc27efd
Merge branch 'main' into sal_shared_mutex
StephanTLavavej Mar 25, 2023
5ea13d1
Don't mark `_NODISCARD_CTOR_LOCK`, `_NODISCARD_TRY_CHANGE_STATE` as `…
StephanTLavavej Mar 25, 2023
f87f24f
Reformat sources, no manual changes.
StephanTLavavej Mar 25, 2023
400f1a0
Manually undo "sticky" wrapping.
StephanTLavavej Mar 25, 2023
4f3d84a
Add 8 empty comments to manually wrap before `_Requires_lock_not_held_`.
StephanTLavavej Mar 25, 2023
4a21d7a
Move `_Pre_satisfies_`, `_Post_satisfies_` to the SAL group.
StephanTLavavej Mar 25, 2023
7db398b
Drop damaged `_Requires_no_locks` (`_Requires_no_locks_held_` was int…
StephanTLavavej Mar 25, 2023
0c00876
Drop unused `_Acquires_lock_`, `_Releases_lock_`.
StephanTLavavej Mar 25, 2023
b6b6cbe
`_Requires_lock_held_` => `_Requires_shared_lock_held_` for `shared_l…
StephanTLavavej Mar 25, 2023
93358b7
Fix annotations for move assignment.
NN--- Mar 25, 2023
59aba82
Fix comparison value
NN--- Mar 25, 2023
63b0e7f
Fix SAL for move assignment
NN--- Mar 25, 2023
8677291
Annotate move assignment.
NN--- Mar 25, 2023
5e272fa
Remove 'this->'.
NN--- Mar 25, 2023
c33beb1
Use _Replaces_lock_ for move assignment.
NN--- Mar 25, 2023
eb0641a
Drop annotations for internal `_Try_lock_shared_until`.
StephanTLavavej Mar 27, 2023
31dde58
Always pair `_Post_satisfies_(_Pmtx == &_Mtx)` with `_Post_same_lock_…
StephanTLavavej Mar 27, 2023
f411403
Avoid dereferencing null in shared_lock move ctor/assign annotations.
StephanTLavavej Mar 27, 2023
cc536d3
unlock() unconditionally releases (assuming preconditions hold).
StephanTLavavej Mar 27, 2023
69e99f5
[no CR comment] unlock(), or unlock() not. There is no "try".
StephanTLavavej Mar 27, 2023
5566ac1
Add `_Post_satisfies_(_Owns == true)` to `lock()`.
StephanTLavavej Mar 27, 2023
7a26e5c
Use `_Old_` in `swap()`'s postconditions.
StephanTLavavej Mar 27, 2023
5a14575
Annotate `shared_lock`'s default constructor.
StephanTLavavej Mar 27, 2023
a055d23
Replace `_Moves_lock_` with fine-grained annotations in `shared_lock`…
StephanTLavavej Mar 28, 2023
f5bb9e8
Replace `_Replaces_lock_` with fine-grained annotations in `shared_lo…
StephanTLavavej Mar 28, 2023
7eb3bda
[no CR comment] Change annotations to say `*this` instead of `this`.
StephanTLavavej Mar 28, 2023
188ce20
[no CR comment] Add `_Analysis_assume_lock_MEOWED_` to silence intern…
StephanTLavavej Mar 28, 2023
8575875
Merge branch 'main' into sal_shared_mutex
StephanTLavavej Mar 28, 2023
4124166
Work around DevCom-10325013 by conditionally reverting GH 3352 here.
StephanTLavavej Mar 28, 2023
e97edd7
Add `_Analysis_suppress_lock_checking_` instead of `_Analysis_assume_…
StephanTLavavej Mar 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,26 @@ StatementMacros:
- _END_EXTERN_C
- _EXTERN_C_UNLESS_PURE
- _END_EXTERN_C_UNLESS_PURE
# SAL
- _Pre_satisfies_
- _Post_satisfies_
- _When_
# Concurrency SAL
- _Requires_lock_held_
- _Requires_exclusive_lock_held_
- _Requires_shared_lock_held_
- _Requires_lock_not_held_
- _Acquires_exclusive_lock_
- _Acquires_shared_lock_
- _Releases_exclusive_lock_
- _Releases_shared_lock_
- _Acquires_nonreentrant_lock_
- _Releases_nonreentrant_lock_
- _Detaches_lock_
- _Moves_lock_
- _Replaces_lock_
- _Swaps_locks_
- _Post_same_lock_
# TabWidth: 8
# UseCRLF: false
UseCRLF: true
Expand Down
3 changes: 2 additions & 1 deletion stl/inc/random
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,8 @@ public:
}

protected:
_Post_satisfies_(this->_Idx == 0) void _Refill_lower() {
_Post_satisfies_(this->_Idx == 0)
void _Refill_lower() {
// compute values for the lower half of the history array
constexpr size_t _Wrap_bound_one = _Nx - _One_mod_n;
constexpr size_t _Wrap_bound_m = _Nx - _M_mod_n;
Expand Down
Loading