libfilezilla
Toggle main menu visibility
Loading...
Searching...
No Matches
lib
libfilezilla
thread.hpp
Go to the documentation of this file.
1
#ifndef LIBFILEZILLA_THREAD_HEADER
2
#define LIBFILEZILLA_THREAD_HEADER
3
4
#include "
libfilezilla.hpp
"
5
6
#include <functional>
7
8
#if !defined(FZ_WINDOWS) || !(defined(__MINGW32__) || defined(__MINGW64__))
9
#include <thread>
10
#endif
11
15
16
namespace
fz
{
17
29
class
FZ_PUBLIC_SYMBOL thread final
30
{
31
public
:
32
#if defined(FZ_WINDOWS) && (defined(__MINGW32__) || defined(__MINGW64__))
33
typedef
uint32_t id;
34
#else
35
typedef
std::thread::id id;
36
#endif
37
38
thread() =
default
;
39
42
~thread
();
43
48
bool
run
(std::function<
void
()> && f);
49
60
void
join
();
61
66
bool
joinable
()
const
;
67
69
static
id
own_id
();
70
71
private
:
72
class
impl;
73
friend
class
impl;
74
impl* impl_{};
75
};
76
77
size_t
FZ_PUBLIC_SYMBOL processor_count();
78
79
}
80
81
#endif
fz::thread::run
bool run(std::function< void()> &&f)
Start the thread.
fz::thread::~thread
~thread()
Implicitly calls join().
fz::thread::join
void join()
Join the thread.
fz::thread::joinable
bool joinable() const
A thread is joinable after having been started and before it has been joined.
fz::thread::own_id
static id own_id()
Returns unique id of the thread calling the function.
libfilezilla.hpp
Sets some global macros and further includes string.hpp.
fz
The namespace used by libfilezilla.
Definition
apply.hpp:17
Generated by
1.17.0