Skip to content

Commit fa5c478

Browse files
committed
苹果上修改为原子操作
1 parent fa6fe05 commit fa5c478

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/CodeFormatServer/Session/IOSession.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22
#include <string>
33
#include <thread>
4+
#include <atomic>
45
#include "asio/io_context.hpp"
56
#include "CodeFormatServer/LanguageService.h"
67
#include "CodeFormatServer/Protocol/ProtocolBuffer.h"
@@ -23,7 +24,7 @@ class IOSession
2324
std::shared_ptr<std::jthread> _logicThread;
2425
#else
2526
std::shared_ptr<std::thread> _logicThread = nullptr;
26-
volatile bool _running = true;
27+
std::atomic<bool> _running = true;
2728
#endif
2829

2930
};

0 commit comments

Comments
 (0)