Skip to content

Atomic bRun in socket#3788

Merged
softins merged 2 commits into
jamulussoftware:mainfrom
softins:atomic-brun-in-socket
Jul 18, 2026
Merged

Atomic bRun in socket#3788
softins merged 2 commits into
jamulussoftware:mainfrom
softins:atomic-brun-in-socket

Conversation

@softins

@softins softins commented Jul 17, 2026

Copy link
Copy Markdown
Member

Short description of changes

Make the bRun boolean in the socket class atomic, for thread safety. Also remove the CSocket::Close method, as it is no longer needed with non-blocking socket reads.

CHANGELOG: Internal: Improve thread safety in socket handling

Context: Fixes an issue?

Replaces #3786 and expands on it, following on from #3774

Does this change need documentation? What needs to be documented and how?

No, bug fix and refactor only

Status of this Pull Request

Ready for review

What is missing until this pull request can be merged?

Checking on all main platforms

Checklist

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

@softins
softins requested a review from ann0see July 17, 2026 15:27
@softins softins added the bug Something isn't working label Jul 17, 2026
@github-project-automation github-project-automation Bot moved this to Triage in Tracking Jul 17, 2026
@softins softins added this to the Release 4.0.0 milestone Jul 17, 2026
@softins softins changed the title Atomic brun in socket Atomic bRun in socket Jul 17, 2026
@softins softins mentioned this pull request Jul 17, 2026

@ann0see ann0see left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good but I'll need to test it on ARM and x86.

We'll need to hunt for similar bugs then. Especially in the windows audio code.

Comment thread src/socket.cpp
@pljones pljones moved this from Triage to In Progress in Tracking Jul 17, 2026
@pljones

pljones commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

I'll give the Windows Client and Linux Server a test today.

@ann0see

ann0see commented Jul 17, 2026

Copy link
Copy Markdown
Member

Actually, testing on iOS would also be beneficial

@softins

softins commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Worked fine on arm64 Pi. I'll test on x86 Mac later.

@softins

softins commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Seems to behave fine as both server and client on Mac x86 10.15

@ann0see ann0see left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am now back on the initial network where I saw the hang, and it seems good now.
Tested with macOS Apple Silicon

@ann0see
ann0see requested a review from pljones July 18, 2026 12:17
mcfnord pushed a commit to mcfnord/jamulus that referenced this pull request Jul 18, 2026
softins already makes this member atomic in jamulussoftware#3788 (which also removes
CSocket::Close in favour of non-blocking reads). Keep only the
bJitterBufferOK conversion in this file; the <atomic> include moves to
match jamulussoftware#3788 so the two branches merge cleanly in either order.

Co-Authored-By: Claude Fable 5 <[email protected]>
@pljones

pljones commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Yeah, no problems between WIndows and Linux yesterday (both x64 machines, so unlikely to suffer).

@github-project-automation github-project-automation Bot moved this from In Progress to Waiting on Team in Tracking Jul 18, 2026
@softins
softins merged commit d3ac7e1 into jamulussoftware:main Jul 18, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting on Team to Done in Tracking Jul 18, 2026
@softins
softins deleted the atomic-brun-in-socket branch July 18, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants