aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/poco/poco/0001-Use-std-atomic-int-instead-of-std-atomic-bool.patch
blob: b06135222ab5473b1c9484f210887ce2d1aad561 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From 4cbb225811205b51b65371d0d8abc2d2af8233b6 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 26 Jan 2023 14:56:36 -0800
Subject: [PATCH] Use std::atomic<int> instead of std::atomic<bool>

GCC on RISCV does not yet support inline subword atomics [1]
Therefore avoid them until fixed

Upstream-Status: Pending

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104338

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 Foundation/include/Poco/AsyncChannel.h | 2 +-
 Foundation/src/AsyncChannel.cpp        | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/Foundation/include/Poco/AsyncChannel.h b/Foundation/include/Poco/AsyncChannel.h
index 190bae7dd..d73ea6c72 100644
--- a/Foundation/include/Poco/AsyncChannel.h
+++ b/Foundation/include/Poco/AsyncChannel.h
@@ -111,7 +111,7 @@ private:
 	NotificationQueue _queue;
 	std::size_t _queueSize = 0;
 	std::size_t _dropCount = 0;
-	std::atomic<bool> _closed;
+	std::atomic<int> _closed;
 };
 
 
diff --git a/Foundation/src/AsyncChannel.cpp b/Foundation/src/AsyncChannel.cpp
index 37cdec477..e829b180c 100644
--- a/Foundation/src/AsyncChannel.cpp
+++ b/Foundation/src/AsyncChannel.cpp
@@ -48,11 +48,10 @@ private:
 	Message _msg;
 };
 
-
 AsyncChannel::AsyncChannel(Channel::Ptr pChannel, Thread::Priority prio):
 	_pChannel(pChannel),
 	_thread("AsyncChannel"),
-	_closed(false)
+	_closed(0)
 {
 	_thread.setPriority(prio);
 }
@@ -95,7 +94,7 @@ void AsyncChannel::open()
 
 void AsyncChannel::close()
 {
-	if (!_closed.exchange(true))
+	if (!_closed.exchange(1))
 	{
 		if (_thread.isRunning())
 		{
-- 
2.39.1