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

Simplify + cleanup running destructors #32

Merged

Conversation

ian-h-chamberlain
Copy link
Member

Follow up to #31

We can keep the loop basically how it was before and avoid the extra Vec collection, as long as we drop the write lock before calling the destructor.

I think this code looks a bit cleaner/simpler too.

@ian-h-chamberlain ian-h-chamberlain requested review from a team, AzureMarker, FenrirWolf and Meziu May 13, 2024 00:44
We can keep the loop basically how it was before and avoid the extra Vec
collection, as long as we drop the write lock before calling the
destructor.
@ian-h-chamberlain ian-h-chamberlain force-pushed the fix/collect-destructors branch from 7fec966 to 0e6f793 Compare May 13, 2024 00:45
Copy link
Member

@Meziu Meziu left a comment

Choose a reason for hiding this comment

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

Great, less allocations is less time wasted on a thread's exit routine. I am still a bit unsure whether everything will work just fine, since there isn't the lock assuring wrongdoings with the local keys, but unlocking is necessary to avoid the deadlock, so there's not much we can do.

LGTM

@ian-h-chamberlain ian-h-chamberlain merged commit 5d9e47a into rust3ds:master May 17, 2024
@ian-h-chamberlain ian-h-chamberlain deleted the fix/collect-destructors branch May 17, 2024 14:47
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.

2 participants