Page MenuHomeFreeBSD

virtual_oss: Clean up pthread on exit
AbandonedPublic

Authored by christos on May 23 2025, 5:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 25, 5:54 PM
Unknown Object (File)
Thu, Jun 25, 5:53 PM
Unknown Object (File)
Tue, Jun 23, 4:28 PM
Unknown Object (File)
Tue, Jun 23, 2:56 PM
Unknown Object (File)
Mon, Jun 22, 8:00 AM
Unknown Object (File)
Sun, Jun 21, 1:50 PM
Unknown Object (File)
Sun, Jun 7, 2:02 AM
Unknown Object (File)
May 2 2026, 11:07 PM
Subscribers
None

Details

Summary

To do that we also need to cache the thread pointers so that we can use
them later in destroy_threads(). Also add error checking on pthread
functions whose return values we care about.

Sponsored by: The FreeBSD Foundation

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

markj added inline comments.
virtual_main.c
2680

I don't see much benefit to explicitly freeing memory right before the process exits.

This revision is now accepted and ready to land.May 25 2025, 6:09 PM
virtual_main.c
2680

I'm aware the OS will clean up resources anyway, but isn't it better to make sure we clean up on our part?

virtual_main.c
2680

The only reason it might be better to clean up is to future-proof it, in case this code is copied into a library for instance. But in that case the change is incomplete, since presumably we'd need to clean up in the error cases as well.

christos marked 2 inline comments as done.

Remove atomic_destroy().

This revision now requires review to proceed.May 28 2025, 3:30 PM