Add asio scheduler null check patch 61/293261/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 23 May 2023 07:24:58 +0000 (16:24 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 23 May 2023 07:24:58 +0000 (16:24 +0900)
https://github.com/chriskohlhoff/asio/issues/642

Change-Id: Ia22ccf9ccf6810080308d5bf7e2244d8f857cbb2

packaging/asio_scheduler.patch [new file with mode: 0644]
packaging/boost.spec

diff --git a/packaging/asio_scheduler.patch b/packaging/asio_scheduler.patch
new file mode 100644 (file)
index 0000000..4217534
--- /dev/null
@@ -0,0 +1,17 @@
+diff --git a/boost/asio/detail/impl/scheduler.ipp b/boost/asio/detail/impl/scheduler.ipp
+index 4ef5c86688..3955625d15 100644
+--- a/boost/asio/detail/impl/scheduler.ipp
++++ b/boost/asio/detail/impl/scheduler.ipp
+@@ -317,8 +317,10 @@ void scheduler::restart()
+ void scheduler::compensating_work_started()
+ {
+-  thread_info_base* this_thread = thread_call_stack::contains(this);
+-  ++static_cast<thread_info*>(this_thread)->private_outstanding_work;
++  if (thread_info_base* this_thread = thread_call_stack::contains(this))
++  {
++    ++static_cast<thread_info*>(this_thread)->private_outstanding_work;
++  }
+ }
+ void scheduler::post_immediate_completion(
index 37c6816..196750a 100644 (file)
@@ -74,6 +74,7 @@ Source4:        existing_extra_docs
 Source1001:     boost.manifest
 Source1002:     boost.pc
 Source1003:     run_test.sh
+Source1004:     asio_scheduler.patch
 
 %define _docdir %{_datadir}/doc/packages/boost-%{version}
 
@@ -409,6 +410,7 @@ Restults of Boost test suite execution
 %setup -q -n %{name}_%{version}
 cp %{SOURCE1001} .
 cp %{SOURCE1002} .
+%{__patch} -p1 < %{SOURCE1004}
 #everything in the tarball has the executable flag set ...
 find -type f ! \( -name \*.sh -o -name \*.py -o -name \*.pl \) -exec chmod -x {} +