Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ThreadUtil: don't use thread APIs if multithreading&commix aren't in use#3884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
kubukoz wants to merge1 commit intoscala-native:main
base:main
Choose a base branch
Loading
fromkubukoz:threadutil-no-threads

Conversation

kubukoz
Copy link
Contributor

Closes#3877

Comment on lines +11 to +17
INLINE
bool mutex_init(mutex_t *ref) { return true; }

INLINE bool mutex_lock(mutex_t *ref) { return true; }

INLINE bool mutex_unlock(mutex_t *ref) { return true; }
#else
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

question: I only needed these three so I implemented only these. Perhaps we should do this on a per-function basis?

Comment on lines +5 to +6
#if !(defined SCALANATIVE_GC_COMMIX || \
defined SCALANATIVE_MULTITHREADING_ENABLED)
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

thought: it'd be good to have a single definition that we can check, e.g. "has pthread" - does something like this exist already?

Copy link
ContributorAuthor

@kubukozkubukozApr 17, 2024
edited
Loading

Choose a reason for hiding this comment

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

also, is this fine or would you rather I flip the boolean (concurrent case first, fallback second)?

Copy link
Member

Choose a reason for hiding this comment

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

By default, all theshared code should be compiled so something is not correct 100%. TheSCALANATIVE_GC_COMMIX is defined only when selecting Commix so that code will get compiled and similar for other GCs. Does this help at all?

Copy link
Member

Choose a reason for hiding this comment

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

It is used by all the internal GCs and also single threaded runtime because no guard against.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

hmm yeah. What I did here was inspired byWojciech's comment on the ticket, but I see that this might not be the best way to do it because it's not really "shared" anymore.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ekrichekrichekrich left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

(playdate support) Missingpthread APIs inThreadUtil
2 participants
@kubukoz@ekrich

[8]ページ先頭

©2009-2025 Movatter.jp