Loading...
Searching...
No Matches

Thread defines an easy way to manipulate a thread. More...

#include <SFML/System/Win32/Thread.hpp>

Inheritance diagram for sf::Thread:
sf::NonCopyable sf::SoundRecorder sf::SoundStream sf::SoundBufferRecorder sf::Music

Public Types

typedef void(*) FuncType(void *)

Public Member Functions

 Thread (FuncType Function, void *UserData=NULL)
 Construct the thread from a function pointer.
virtual ~Thread ()
 Virtual destructor.
void Launch ()
 Create and run the thread.
void Wait ()
 Wait until the thread finishes.
void Terminate ()
 Terminate the thread Terminating a thread with this function is not safe, you should rather try to make the thread function terminate by itself.

Protected Member Functions

 Thread ()
 Default constructor.

Detailed Description

Thread defines an easy way to manipulate a thread.

There are two ways to use Thread :

  • Inherit from it and override the Run() virtual function
  • Construct a Thread instance and pass it a function pointer to call

Definition at line 44 of file Win32/Thread.hpp.

Member Typedef Documentation

◆ FuncType

typedef void(*) sf::Thread::FuncType(void *)

Definition at line 48 of file Win32/Thread.hpp.

Constructor & Destructor Documentation

◆ Thread() [1/2]

sf::Thread::Thread ( FuncType Function,
void * UserData = NULL )

Construct the thread from a function pointer.

Parameters
Function: Entry point of the thread
UserData: Data to pass to the thread function (NULL by default)

◆ ~Thread()

virtual sf::Thread::~Thread ( )
virtual

Virtual destructor.

◆ Thread() [2/2]

sf::Thread::Thread ( )
protected

Default constructor.

Member Function Documentation

◆ Launch()

void sf::Thread::Launch ( )

Create and run the thread.

◆ Terminate()

void sf::Thread::Terminate ( )

Terminate the thread Terminating a thread with this function is not safe, you should rather try to make the thread function terminate by itself.

◆ Wait()

void sf::Thread::Wait ( )

Wait until the thread finishes.


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