Skip to content

Conversation

@niaow
Copy link
Member

@niaow niaow commented Nov 9, 2025

Previously, we created joinable threads.
As a result, all threads would be kept alive after completion so that pthread_join could wait for them. We never call pthread_join, so threads would never get cleaned up.

Additionally, the thread creation error check was performed after waiting for the thread to start. If pthread_create failed, the caller would get stuck waiting for a thread that was never created.

Previously, we created joinable threads.
As a result, all threads would be kept alive after completion so that pthread_join could wait for them.
We never call pthread_join, so threads would never get cleaned up.

Additionally, the thread creation error check was performed after waiting for the thread to start.
If pthread_create failed, the caller would get stuck waiting for a thread that was never created.
Copy link
Member

@deadprogram deadprogram left a comment

Choose a reason for hiding this comment

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

Very good catch on that @niaow thank you! Now merging.

@deadprogram deadprogram merged commit 326ca42 into tinygo-org:dev Nov 10, 2025
19 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.

2 participants