Page MenuHomeFreeBSD

ctfmerge: fix segfault when building on macOS
ClosedPublic

Authored by mp on Mon, Dec 1, 6:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 19, 11:45 PM
Unknown Object (File)
Fri, Dec 19, 6:58 AM
Unknown Object (File)
Thu, Dec 18, 7:47 AM
Unknown Object (File)
Wed, Dec 17, 11:16 PM
Unknown Object (File)
Tue, Dec 16, 7:21 AM
Unknown Object (File)
Mon, Dec 15, 4:42 PM
Unknown Object (File)
Mon, Dec 15, 9:29 AM
Unknown Object (File)
Thu, Dec 11, 8:13 PM
Subscribers

Details

Summary

The barrier code was using semaphores which have been deprecated in
macOS and not working at all, causing a race condition. Since macOS
does not have pthread_barrier_*(), this change uses a condition
variable instead.

PR: 290958
Reported by: wosch
MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mp requested review of this revision.Mon, Dec 1, 6:46 PM
This revision is now accepted and ready to land.Mon, Dec 1, 6:52 PM
This revision was automatically updated to reflect the committed changes.

Why not just replace the entirety of barrier.[ch] with pthread_barrier(3)?

Why not just replace the entirety of barrier.[ch] with pthread_barrier(3)?

I had the same thought, but apparently macOS doesn't implement it.

Why not just replace the entirety of barrier.[ch] with pthread_barrier(3)?

I had the same thought, but apparently macOS doesn't implement it.

Huh. TIL.