Skip to content

osthread: suspend() and resume() code deduplication#23361

Open
denizzzka wants to merge 8 commits into
dlang:masterfrom
denizzzka:osthread_code_dedup
Open

osthread: suspend() and resume() code deduplication#23361
denizzzka wants to merge 8 commits into
dlang:masterfrom
denizzzka:osthread_code_dedup

Conversation

@denizzzka

@denizzzka denizzzka commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Got rid of the repeating blocks:

        if ( t.m_addr != xxxx() && yyyyy( t.m_tmach ) != KERN_SUCCESS )
        {
            if ( !t.isRunning )
            {
                Thread.remove( t );
                return false;
            }
            onThreadError( "Unable to suspend thread" );
        }

System-related code moved to appropriate dedicated modules in last two commits: for review you can look except these comments - PR becomes clean and understandable

I removed these commits: a separate PR transfer will be done for moving

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

@denizzzka denizzzka force-pushed the osthread_code_dedup branch from 2634c78 to 4b9d13b Compare July 4, 2026 17:27
@denizzzka denizzzka changed the title [Do not merge] osthread: suspend & resume code deduplication osthread: suspend() code deduplication Jul 4, 2026
@denizzzka denizzzka force-pushed the osthread_code_dedup branch from b629454 to 805d08f Compare July 4, 2026 18:29
@denizzzka denizzzka marked this pull request as ready for review July 4, 2026 18:30


// Returns true on success
// TODO: move to posix_impl module

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.

At the moment it is difficult to do this: it clings to other symbols that have not yet been transferred to posix_impl

@denizzzka denizzzka changed the title osthread: suspend() code deduplication osthread: suspend() and resume() code deduplication Jul 4, 2026
@denizzzka denizzzka force-pushed the osthread_code_dedup branch from 0f1d209 to 776b6d4 Compare July 4, 2026 19:34
@denizzzka

Copy link
Copy Markdown
Contributor Author

@QuantumSegfault This PR touches WASI implementation

@QuantumSegfault QuantumSegfault 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.

LGTM for WASI

Comment thread druntime/src/core/thread/wasi_impl.d
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