[GH-ISSUE #2249] Convert pthread_mutex / custom AutoLock to standard C++11 std::mutex / std::lock_guard #1136

Closed
opened 2026-03-04 01:51:39 +03:00 by kerem · 1 comment
Owner

Originally created by @gaul on GitHub (Aug 6, 2023).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2249

Now that s3fs requires C++11 we can use standard locking. The primary benefit is to better cooperate with Clang thread safety static analysis. It is possible that this is better for a future native Windows port as well. Note that this change is non-trivial due to the way that s3fs currently avoids recursive locking. It isn't obvious how to use the same flag pattern. My initial attempt at this shows some locking oddities that the dynamic ThreadSanitizer does not flag and may only coincidentally work.

Originally created by @gaul on GitHub (Aug 6, 2023). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2249 Now that s3fs requires C++11 we can use standard locking. The primary benefit is to better cooperate with [Clang thread safety static analysis](https://clang.llvm.org/docs/ThreadSafetyAnalysis.html). It is possible that this is better for a future native Windows port as well. Note that this change is non-trivial due to the way that s3fs currently avoids recursive locking. It isn't obvious how to use the same flag pattern. My initial attempt at this shows some locking oddities that the dynamic ThreadSanitizer does not flag and may only coincidentally work.
kerem closed this issue 2026-03-04 01:51:39 +03:00
Author
Owner

@gaul commented on GitHub (Jul 5, 2024):

Fixed by #2466 and #2476.

<!-- gh-comment-id:2210213156 --> @gaul commented on GitHub (Jul 5, 2024): Fixed by #2466 and #2476.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1136
No description provided.