# ThreadObject Class Reference

A Thread Object which works on all our supported OSes. More...

`#include <thread.h>`

Inheritance diagram for ThreadObject:

## Public Member Functions
virtual | ~ThreadObject ()
| Virtual destructor to allow 'delete' operator to work properly.
virtual bool | Exit ()=0
| Exit this thread.
virtual void | Join ()=0
| Join this thread.
## Static Public Member Functions
static bool | New (OTTDThreadFunc proc, void *param, ThreadObject **thread=NULL)
| Create a thread; proc will be called as first function inside the thread, with optinal params.

## Detailed Description

A Thread Object which works on all our supported OSes.

Definition at line 22 of file thread.h.

## Member Function Documentation

bool ThreadObject::New | ( | OTTDThreadFunc | proc,
|  | void * | param,
|  | ThreadObject ** | thread = `NULL` |
| ) |  |  | `[static]`

Create a thread; proc will be called as first function inside the thread, with optinal params.

Parameters:

  | proc | The procedure to call inside the thread.
  | param | The params to give with 'proc'.
  | thread | Place to store a pointer to the thread in. May be NULL.

Returns:
  True if the thread was started correctly.

Definition at line 194 of file thread_morphos.cpp.

Referenced by GenerateWorld(), NetworkUDPRemoveAdvertise(), SaveOrLoad(), and TCPConnecter::TCPConnecter().

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

- src/thread/thread.h
- src/thread/thread_morphos.cpp
- src/thread/thread_none.cpp
- src/thread/thread_os2.cpp
- src/thread/thread_pthread.cpp
- src/thread/thread_win32.cpp