Skip to content

osthread: divides some another piece of OS-related code over *_impl modules - #23516

Open
denizzzka wants to merge 3 commits into
dlang:masterfrom
denizzzka:osthread_next_split
Open

osthread: divides some another piece of OS-related code over *_impl modules#23516
denizzzka wants to merge 3 commits into
dlang:masterfrom
denizzzka:osthread_next_split

Conversation

@denizzzka

@denizzzka denizzzka commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What is happening is part of the process of separating code from different platforms into different modules

Only 2 or 3 similar PRs left for the osthread module

}

version (CoreDdoc) {} else
public alias getpid = imported!"core.sys.windows.winbase".GetCurrentProcessId;

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.

Why are these not public imports?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This approach was introduced in #20632

@denizzzka
denizzzka force-pushed the osthread_next_split branch from 0244a0d to 2b4289a Compare August 3, 2026 19:49
@denizzzka
denizzzka force-pushed the osthread_next_split branch from 2b4289a to 2cf6a09 Compare August 3, 2026 20:04
version (CoreDdoc)
{
alias getpid = imported!"core.sys.windows.winbase".GetCurrentProcessId;
size_t getpid() nothrow @nogc { return 0; }

@denizzzka denizzzka Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't know what return type to put here because implementation may be different for different platforms, so I wrote size_t

// Call these routines when entering/leaving critical sections of the code that
// are not cancellation points.

extern (C) int thread_cancelDisable() nothrow

@denizzzka denizzzka Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Why we declare thread_cancelDisable() and thread_cancelRestore() as public?

@denizzzka
denizzzka force-pushed the osthread_next_split branch from 8d8cd57 to 386da2c Compare August 3, 2026 20:49
@denizzzka denizzzka changed the title osthread: next platform-based split, work in progress osthread: divides some another piece of OS-related code over *_impl modules Aug 3, 2026
@denizzzka
denizzzka marked this pull request as ready for review August 3, 2026 20:57
@denizzzka
denizzzka force-pushed the osthread_next_split branch from 386da2c to a627a21 Compare August 4, 2026 10:36
@denizzzka

Copy link
Copy Markdown
Contributor Author

@thewilsonator

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.

2 participants