Loading...
Searching...
No Matches
mce::core::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::core::ThreadImpl::ThreadImpl | ( | Thread * | owner | ) |

Construct a ThreadImpl bound to its owner.

Parameters

  owner | Pointer 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::core::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::core::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:

- Minecraft-Community-Edition/Core/ThreadImpl.hpp