Skip to content

sync: freebsd specific version - #19962

Merged
spytheman merged 5 commits into
vlang:masterfrom
felipensp:sync_freebsd
Nov 23, 2023
Merged

spytheman merged 5 commits into
vlang:masterfrom
felipensp:sync_freebsd

Conversation

@felipensp

@felipensp felipensp commented Nov 21, 2023 •

Copy link
Copy Markdown
Member

Fix #19946

πŸ€–[deprecated] Generated by Copilot at 5841084

Add sync_freebsd.v file to implement the sync module for FreeBSD. The file provides concurrency primitives using the C pthread and semaphore libraries. The change improves V's portability and compatibility on different operating systems.

πŸ€–[deprecated] Generated by Copilot at 5841084

  • Implement sync module for FreeBSD platform (link)

@spytheman

Copy link
Copy Markdown
Contributor

That is a bit weird to me. I expected that the new platform file will be a copy of vlib/sync/sync_darwin.c.v, but apparently it worked with a copy of the default one πŸ€”, with just minimal changes.

@felipensp

felipensp commented Nov 22, 2023 •

Copy link
Copy Markdown
Member Author

That is a bit weird to me. I expected that the new platform file will be a copy of vlib/sync/sync_darwin.c.v, but apparently it worked with a copy of the default one πŸ€”, with just minimal changes.

On Darwin implementation it does not use pointer in the typedef too (just like Linux).

image

@felipensp
felipensp marked this pull request as ready for review November 23, 2023 01:10
@felipensp

Copy link
Copy Markdown
Member Author

That is a bit weird to me. I expected that the new platform file will be a copy of vlib/sync/sync_darwin.c.v, but apparently it worked with a copy of the default one πŸ€”, with just minimal changes.

On this FreeBSD implementation, it does expects ** pointers to be provided to handle the allocation itself.

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've tested the latest changes on my FreeBSD vps, and indeed works well. Excellent work.

@spytheman
spytheman merged commit 9d7fe51 into vlang:master Nov 23, 2023
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.

using -cc clang, compiling v with -cstrict fails

2 participants