Skip to content

[Fix] #478 Improve thread safety and shutdown handling in GpioDDigitalInput - #479

Merged
FDelporte merged 1 commit into
developfrom
fix/#478
Aug 25, 2025
Merged

[Fix] #478 Improve thread safety and shutdown handling in GpioDDigitalInput#479
FDelporte merged 1 commit into
developfrom
fix/#478

Conversation

@eitch

@eitch eitch commented Aug 25, 2025

Copy link
Copy Markdown
Member

Fixed the subtle remaining race condition on initialization of the monitoring task

…lInput

Introduced a volatile `running` flag to properly manage the lifecycle of the input listener thread. Enhanced shutdown logic to ensure threads are safely and consistently terminated.
@eitch
eitch requested a review from FDelporte August 25, 2025 06:30
@FDelporte

Copy link
Copy Markdown
Member

@mpilone can you review please?

@mpilone

mpilone commented Aug 25, 2025

Copy link
Copy Markdown
Contributor

Looks good to me. I think the code could be simplified even more by checking Thread.currentThread.isInterrupted() in the monitor loop rather than a separate boolean and the shutdown code could wait on inputListener.get() rather than the separate countdown latch, but these changes should fix the immediate issue. Thanks for the quick fix.

@FDelporte
FDelporte merged commit 941bf39 into develop Aug 25, 2025
1 check passed
@eitch
eitch deleted the fix/#478 branch September 11, 2025 07:22
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