Skip to content

[pull] main from facebook:main #343

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

Merged
merged 9 commits into from
Jun 12, 2025
Merged

[pull] main from facebook:main #343

merged 9 commits into from
Jun 12, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented Jun 12, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Nitin Garg and others added 9 commits June 12, 2025 09:04
Summary:
The variant with and without deleter are almost the same except for
how the ElementWrapper is initialized. Move the common code to a new helper
function.

Reviewed By: yfeldblum

Differential Revision: D76394950

fbshipit-source-id: d3c820513ab3578567a9ba766643bd422ee07fca
Summary:
Recently added debug checks to ensure value in a ThreadLocal's elements
array matches the value cached in ThreadEntrySet can cause a test that accesses
the TL object under an Accessor will hang. Make the check use a tryRLock and
skip checking if the lock acquire fails.

Differential Revision: D76487384

fbshipit-source-id: 738adac7a8be23636b2187dc885736021d89e408
Summary:
There was a regression in non-debug builds only where the converting-ctor would throw when it is specified not to, and where existing tests check that it does not.

Regression blames to: {D74599633}.

Reviewed By: Orvid

Differential Revision: D76456879

fbshipit-source-id: e48895b05ca6016b6bd5e4965c5c446a5fc4e4e0
Summary: Prefer C++ constants over preprocessor symbols. In particular, prefer `folly::kIsDebug` over `!defined(NDEBUG)`.

Reviewed By: Orvid

Differential Revision: D76457502

fbshipit-source-id: 7e232720c9c6965ca31726fd9971890aff0e591b
Summary:
Make `TimedMutex` and `TimedRWMutexImpl` share the waiter implementation and use folly wrappers for boost intrusive lists for consistency.

This is preparation for the next diff, there are no logic changes.

Reviewed By: ilvokhin

Differential Revision: D76337624

fbshipit-source-id: 8be374bc17c6674a57ea55613f767f047b37fe2a
…utex

Summary:
Fiber `TimedMutex` implementations currently wake the readers while holding the spinlock. Waking up can be a very expensive operation (potentially involving syscalls) and it can result in a preemption, so they should not be done in the critical section.

This is generally easy except for one case: when the waiting thread times out, the waiter may be removed from the list and destroyed, and since the waker is not holding the spinlock anymore there is no protection.

So, we change the waiter to delay destruction until it has been awoken. This creates the simple contract that whoever removes the waiter from the list has to awake it, which guarantees that the waiter is never destroyed in a non-awoken state.

Reviewed By: ilvokhin

Differential Revision: D76337625

fbshipit-source-id: d097c211e3b16a669076a932ff407677dda96b1d
…s/test [B]

Reviewed By: dtolnay

Differential Revision: D76516344

fbshipit-source-id: b624be1c397e933d8f5d1d5b6f18435a23b11d4e
…s/test [A]

Reviewed By: dtolnay

Differential Revision: D76516139

fbshipit-source-id: 0fe2e6af2932d4bd0c854add1280a2ba30d37ac3
@pull pull bot added the ⤵️ pull label Jun 12, 2025
@pull pull bot merged commit 529bd9a into nsclass:main Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants