Deskflow
1.26.0.418
Keyboard and mouse sharing utility
Toggle main menu visibility
Loading...
Searching...
No Matches
Thread.h
Go to the documentation of this file.
1
/*
2
* Deskflow -- mouse and keyboard sharing utility
3
* SPDX-FileCopyrightText: (C) 2012 - 2016 Synergy App Ltd
4
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
5
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
6
*/
7
8
#pragma once
9
10
#include "
arch/IArchMultithread.h
"
11
12
class
IJob
;
13
15
31
// note -- do not derive from this class
32
class
Thread
33
{
34
public
:
36
40
explicit
Thread
(
IJob
*adoptedJob);
41
43
47
Thread
(
const
Thread
&);
48
50
55
~Thread
();
56
58
59
61
66
Thread
&
operator=
(
const
Thread
&);
67
69
81
[[noreturn]]
static
void
exit
(
void
*);
82
84
109
void
cancel
();
110
112
117
void
setPriority
(
int
n);
118
120
124
void
unblockPollSocket
();
125
127
129
131
134
static
Thread
getCurrentThread
();
135
137
145
static
void
testCancel
();
146
148
158
bool
wait
(
double
timeout
= -1.0)
const
;
159
161
168
void
*
getResult
()
const
;
169
171
176
IArchMultithread::ThreadID
getID
()
const
;
177
179
182
bool
operator==
(
const
Thread
&)
const
;
184
185
private
:
186
explicit
Thread
(
ArchThread
);
187
188
static
void
*threadFunc(
void
*);
189
190
private
:
191
ArchThread
m_thread =
nullptr
;
192
};
timeout
static fd_set FAR fd_set FAR fd_set FAR const struct timeval FAR * timeout
Definition
ArchNetworkWinsock.cpp:41
IArchMultithread.h
ArchThread
ArchThreadImpl * ArchThread
Opaque thread type. An opaque type representing a thread.
Definition
IArchMultithread.h:54
IArchMultithread::ThreadID
unsigned int ThreadID
Type of thread identifier.
Definition
IArchMultithread.h:67
IJob
Job interface.
Definition
IJob.h:16
Thread::Thread
Thread(IJob *adoptedJob)
Run adoptedJob in a new thread.
Definition
Thread.cpp:21
Thread::exit
static void exit(void *)
Terminate the calling thread.
Definition
Thread.cpp:58
Thread::unblockPollSocket
void unblockPollSocket()
Force pollSocket() to return.
Definition
Thread.cpp:73
Thread::getCurrentThread
static Thread getCurrentThread()
Get current thread's handle.
Definition
Thread.cpp:78
Thread::getID
IArchMultithread::ThreadID getID() const
Get the thread id.
Definition
Thread.cpp:101
Thread::operator==
bool operator==(const Thread &) const
Compare thread handles.
Definition
Thread.cpp:106
Thread::wait
bool wait(double timeout=-1.0) const
Wait for thread to terminate.
Definition
Thread.cpp:88
Thread::setPriority
void setPriority(int n)
Change thread priority.
Definition
Thread.cpp:68
Thread::operator=
Thread & operator=(const Thread &)
Assign thread handle.
Definition
Thread.cpp:46
Thread::cancel
void cancel()
Cancel thread.
Definition
Thread.cpp:63
Thread::testCancel
static void testCancel()
Test for cancellation.
Definition
Thread.cpp:83
Thread::getResult
void * getResult() const
Get the exit result.
Definition
Thread.cpp:93
src
lib
mt
Thread.h
Generated by
1.18.0