DotNetDupe
4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Toggle main menu visibility
Loading...
Searching...
No Matches
Thread.h
Go to the documentation of this file.
1
3
4
#pragma once
5
6
#include "
Common.h
"
7
#include "
System/Object.h
"
8
#include "
System/String.h
"
9
#include "
System/Action.h
"
10
#include "
System/SmartPointer.h
"
11
12
namespace
DotNetDupe
{
13
namespace
System
{
14
namespace
Threading
{
15
16
typedef
Action<>
ThreadStart
;
17
typedef
Action<Object*>
ParameterizedThreadStart
;
18
28
class
Thread
:
public
Object
{
29
public
:
32
DOTNETDUPE_API
Thread
(
ThreadStart
start);
33
36
DOTNETDUPE_API
Thread
(
ParameterizedThreadStart
start);
37
38
DOTNETDUPE_API
~Thread
()
override
;
39
41
DOTNETDUPE_API
void
Start
();
42
45
DOTNETDUPE_API
void
Start
(
Object
* parameter);
46
48
DOTNETDUPE_API
void
Join
();
49
54
DOTNETDUPE_API
bool
Join
(
int
millisecondsTimeout);
55
58
DOTNETDUPE_API
static
void
Sleep
(
int
millisecondsTimeout);
59
62
DOTNETDUPE_API
bool
IsAlive
()
const
;
63
66
DOTNETDUPE_API
String
GetName
()
const
;
67
70
DOTNETDUPE_API
void
SetName
(
const
String
& name);
71
74
DOTNETDUPE_API
static
Thread
*
GetCurrentThread
();
75
78
DOTNETDUPE_API
static
int
GetCurrentThreadId
();
79
80
private
:
81
Thread
();
// For internal use (main thread wrapper)
82
static
SmartPointer<Thread>
CreateCurrentThreadWrapper();
83
84
struct
Impl;
85
Impl* m_pImpl;
86
87
static
thread_local
Thread
* _currentThread;
88
89
void
ThreadMain(
Object
* parameter);
90
};
91
}
92
}
93
}
Action.h
Encapsulates a delegate method that has parameters and returns void.
Common.h
Defines common cross-platform macros, export decorators, and fundamental types.
DOTNETDUPE_API
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Definition
Common.h:20
Object.h
Base object class for DotNetDupe mirroring .NET System.Object.
SmartPointer.h
Provides reference-counted and weak pointer memory management primitives ensuring zero raw ownership.
String.h
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
DotNetDupe::System::Action<>
Definition
Action.h:51
DotNetDupe::System::Action
Encapsulates a method that has parameters and does not return a value.
Definition
Action.h:46
DotNetDupe::System::Object
Supports all classes in the DotNetDupe class hierarchy.
Definition
Object.h:18
DotNetDupe::System::SmartPointer
A unified smart pointer that supports both unique and shared ownership semantics.
Definition
SmartPointer.h:72
DotNetDupe::System::String
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
Definition
String.h:74
DotNetDupe::System::Threading::Thread::GetName
String GetName() const
Gets the friendly name of the thread.
Definition
Thread.cpp:129
DotNetDupe::System::Threading::Thread::GetCurrentThreadId
static int GetCurrentThreadId()
Returns an integer identifier for the current managed thread.
Definition
Thread.cpp:148
DotNetDupe::System::Threading::Thread::Thread
Thread(ThreadStart start)
Initializes a new instance of the Thread class with a parameterless start delegate.
Definition
Thread.cpp:38
DotNetDupe::System::Threading::Thread::Join
void Join()
Blocks the calling thread until the thread represented by this instance terminates.
Definition
Thread.cpp:92
DotNetDupe::System::Threading::Thread::Start
void Start()
Causes the operating system to change the state of the current instance to Running.
Definition
Thread.cpp:78
DotNetDupe::System::Threading::Thread::Sleep
static void Sleep(int millisecondsTimeout)
Suspends the current thread for the specified number of milliseconds.
Definition
Thread.cpp:120
DotNetDupe::System::Threading::Thread::IsAlive
bool IsAlive() const
Gets a value indicating the execution status of the current thread.
Definition
Thread.cpp:125
DotNetDupe::System::Threading::Thread::GetCurrentThread
static Thread * GetCurrentThread()
Gets the currently running thread.
Definition
Thread.cpp:137
DotNetDupe::System::Threading::Thread::SetName
void SetName(const String &name)
Sets the friendly name of the thread.
Definition
Thread.cpp:133
DotNetDupe::System::Threading
Definition
AbandonedMutexException.h:11
DotNetDupe::System::Threading::ThreadStart
Action ThreadStart
Definition
Thread.h:16
DotNetDupe::System::Threading::ParameterizedThreadStart
Action< Object * > ParameterizedThreadStart
Definition
Thread.h:17
DotNetDupe::System
Definition
Action.h:11
DotNetDupe
Definition
IServiceCollection.h:7
Include
System
Threading
Thread.h
Generated by
1.18.0