summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/fiber.cpp5
-rw-r--r--src/common/fiber.h8
-rw-r--r--src/common/spin_lock.cpp3
3 files changed, 8 insertions, 8 deletions
diff --git a/src/common/fiber.cpp b/src/common/fiber.cpp
index 050c93acb..1220eddf0 100644
--- a/src/common/fiber.cpp
+++ b/src/common/fiber.cpp
@@ -32,13 +32,12 @@ void __stdcall Fiber::FiberStartFunc(void* fiber_parameter) {
32} 32}
33 33
34Fiber::Fiber(std::function<void(void*)>&& entry_point_func, void* start_parameter) 34Fiber::Fiber(std::function<void(void*)>&& entry_point_func, void* start_parameter)
35 : guard{}, entry_point{std::move(entry_point_func)}, start_parameter{start_parameter}, 35 : entry_point{std::move(entry_point_func)}, start_parameter{start_parameter} {
36 previous_fiber{} {
37 impl = std::make_unique<FiberImpl>(); 36 impl = std::make_unique<FiberImpl>();
38 impl->handle = CreateFiber(0, &FiberStartFunc, this); 37 impl->handle = CreateFiber(0, &FiberStartFunc, this);
39} 38}
40 39
41Fiber::Fiber() : guard{}, entry_point{}, start_parameter{}, previous_fiber{} { 40Fiber::Fiber() {
42 impl = std::make_unique<FiberImpl>(); 41 impl = std::make_unique<FiberImpl>();
43} 42}
44 43
diff --git a/src/common/fiber.h b/src/common/fiber.h
index 598fe7daa..7e3b130a4 100644
--- a/src/common/fiber.h
+++ b/src/common/fiber.h
@@ -67,10 +67,10 @@ private:
67 67
68 struct FiberImpl; 68 struct FiberImpl;
69 69
70 SpinLock guard; 70 SpinLock guard{};
71 std::function<void(void*)> entry_point; 71 std::function<void(void*)> entry_point{};
72 void* start_parameter; 72 void* start_parameter{};
73 std::shared_ptr<Fiber> previous_fiber; 73 std::shared_ptr<Fiber> previous_fiber{};
74 std::unique_ptr<FiberImpl> impl; 74 std::unique_ptr<FiberImpl> impl;
75 bool is_thread_fiber{}; 75 bool is_thread_fiber{};
76}; 76};
diff --git a/src/common/spin_lock.cpp b/src/common/spin_lock.cpp
index 82a1d39ff..c7b46aac6 100644
--- a/src/common/spin_lock.cpp
+++ b/src/common/spin_lock.cpp
@@ -35,8 +35,9 @@ void thread_pause() {
35namespace Common { 35namespace Common {
36 36
37void SpinLock::lock() { 37void SpinLock::lock() {
38 while (lck.test_and_set(std::memory_order_acquire)) 38 while (lck.test_and_set(std::memory_order_acquire)) {
39 thread_pause(); 39 thread_pause();
40 }
40} 41}
41 42
42void SpinLock::unlock() { 43void SpinLock::unlock() {