Skip to content

Allow using locks while TLS is destructed#61

Merged
bertptrs merged 1 commit into
bertptrs:masterfrom
qsr:tls_safe
Jun 19, 2026
Merged

Allow using locks while TLS is destructed#61
bertptrs merged 1 commit into
bertptrs:masterfrom
qsr:tls_safe

Conversation

@qsr

@qsr qsr commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@qsr qsr force-pushed the tls_safe branch 2 times, most recently from 30447db to 02578e6 Compare June 16, 2026 10:32
@djkoloski

Copy link
Copy Markdown

Note that this changes the behavior of locking so that when we don't know what locks this thread holds (i.e. during thread teardown), we allow locking to proceed. The old behavior is to panic in that situation.

@bertptrs bertptrs left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR. The testcase clearly demonstrates what goes wrong.

As @djkoloski mentions, this does technically change behaviour, but the current behaviour results in an unhelpful

fatal runtime error: thread local panicked on drop, aborting

which isn't informative. Since regular dependency tracking cannot continue at this point, I believe letting it slide is the way forward.

Could you address my review comment and run cargo fmt on your code? Other than that LGTM.

Comment thread src/lib.rs Outdated
@qsr qsr requested a review from bertptrs June 19, 2026 13:53
@bertptrs bertptrs merged commit de52d26 into bertptrs:master Jun 19, 2026
7 checks passed
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.

3 participants