Minecraft Community Edition 0.1.0
Loading...
Searching...
No Matches
mce::ThreadImpl Class Reference

Platform-specific thread implementation. More...

#include <ThreadImpl.hpp>

Public Member Functions

 ThreadImpl (Thread *owner)
 Construct a ThreadImpl bound to its owner.
void wait ()
 Block until the associated thread exits.
void terminate ()
 Request termination of the associated thread.
bool isRunning () const

Detailed Description

Platform-specific thread implementation.

This class encapsulates native thread handles and provides a small interface for the Thread wrapper to control thread lifetime.

It is intentionally non-copyable (implicitly, due to native handles).

Constructor & Destructor Documentation

◆ ThreadImpl()

mce::ThreadImpl::ThreadImpl ( Thread * owner)

Construct a ThreadImpl bound to its owner.

Parameters
ownerPointer to the high-level Thread object that owns this implementation.

The owner is stored by reference only for use inside the static entryPoint function to call back into Thread::run() or equivalent.

Member Function Documentation

◆ terminate()

void mce::ThreadImpl::terminate ( )

Request termination of the associated thread.

Implementations may signal the thread to stop or forcibly terminate the native thread handle depending on platform support and usage.

Note
Prefer cooperative shutdown via shared flags when possible.

◆ wait()

void mce::ThreadImpl::wait ( )

Block until the associated thread exits.

On success this method returns after the remote thread has terminated. Behavior and error handling are platform-specific.


The documentation for this class was generated from the following file: