Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package belr for openSUSE:Factory checked in at 2023-08-28 17:17:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/belr (Old) and /work/SRC/openSUSE:Factory/.belr.new.1766 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "belr" Mon Aug 28 17:17:06 2023 rev:21 rq:1106264 version:5.2.98 Changes: -------- --- /work/SRC/openSUSE:Factory/belr/belr.changes 2023-04-16 19:13:23.401451178 +0200 +++ /work/SRC/openSUSE:Factory/.belr.new.1766/belr.changes 2023-08-28 17:17:10.852885976 +0200 @@ -1,0 +2,6 @@ +Mon Aug 28 08:11:11 UTC 2023 - Paolo Stivanin <i...@paolostivanin.com> + +- Update to 5.2.98 (no changelog) +- Add set_current_version.patch. + +------------------------------------------------------------------- Old: ---- belr-5.2.51.tar.bz2 New: ---- belr-5.2.98.tar.bz2 set_current_version.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ belr.spec ++++++ --- /var/tmp/diff_new_pack.kDcBt4/_old 2023-08-28 17:17:12.240935820 +0200 +++ /var/tmp/diff_new_pack.kDcBt4/_new 2023-08-28 17:17:12.244935964 +0200 @@ -19,7 +19,7 @@ %define soname libbelr %define sover 1 Name: belr -Version: 5.2.51 +Version: 5.2.98 Release: 0 Summary: Language recognition library License: GPL-3.0-or-later @@ -29,11 +29,12 @@ Source1: baselibs.conf # PATCH-FIX-OPENSUSE belr-fix-pkgconfig.patch sor.ale...@meowr.ru -- Install belr.pc. Patch0: belr-fix-pkgconfig.patch +Patch1: set_current_version.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: libudev-devel BuildRequires: pkgconfig -BuildRequires: pkgconfig(bctoolbox) >= 5.0.0 +BuildRequires: pkgconfig(bctoolbox) >= %{version} %description Belr parses input formatted according to a language defined by an ++++++ belr-5.2.51.tar.bz2 -> belr-5.2.98.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/belr-5.2.51/include/belr/parser.h new/belr-5.2.98/include/belr/parser.h --- old/belr-5.2.51/include/belr/parser.h 2023-02-23 18:42:08.000000000 +0100 +++ new/belr-5.2.98/include/belr/parser.h 2023-07-27 15:58:13.000000000 +0200 @@ -26,6 +26,12 @@ #include <vector> #include <sstream> +#define BELR_USE_ATOMIC 1 + +#if BELR_USE_ATOMIC +#include <atomic> +#endif + #include "bctoolbox/defs.h" #include "belr.h" @@ -141,6 +147,9 @@ const Parser<_parserElementT> &mParser; std::string mRulename; std::shared_ptr<HandlerContext<_parserElementT>> mCachedContext; +#if BELR_USE_ATOMIC + std::atomic_flag mCacheLocked = ATOMIC_FLAG_INIT; +#endif }; @@ -468,17 +477,37 @@ template <typename _parserElementT> void ParserHandlerBase< _parserElementT >::releaseContext(const std::shared_ptr<HandlerContext<_parserElementT>> &ctx){ +#if BELR_USE_ATOMIC + if (mCacheLocked.test_and_set(std::memory_order_relaxed) == false){ + mCachedContext = ctx; + mCacheLocked.clear(std::memory_order_relaxed); + } +#else mCachedContext=ctx; +#endif } template <typename _parserElementT> std::shared_ptr<HandlerContext<_parserElementT>> ParserHandlerBase<_parserElementT>::createContext(){ +#if BELR_USE_ATOMIC + std::shared_ptr<HandlerContext<_parserElementT>> ret; + if (mCacheLocked.test_and_set(std::memory_order_relaxed) == false){ + if (mCachedContext){ + ret = mCachedContext; + mCachedContext.reset(); + } + mCacheLocked.clear(std::memory_order_relaxed); + } + if (!ret) ret = std::make_shared<HandlerContext<_parserElementT>>(this); + return ret; +#else if (mCachedContext) { std::shared_ptr<HandlerContext<_parserElementT>> ret=mCachedContext; mCachedContext.reset(); return ret; } return std::make_shared<HandlerContext<_parserElementT>>(this); +#endif } // diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/belr-5.2.51/tester/grammar-tester.cpp new/belr-5.2.98/tester/grammar-tester.cpp --- old/belr-5.2.51/tester/grammar-tester.cpp 2023-02-23 18:42:08.000000000 +0100 +++ new/belr-5.2.98/tester/grammar-tester.cpp 2023-07-27 15:58:13.000000000 +0200 @@ -139,5 +139,6 @@ NULL, NULL, sizeof(tests) / sizeof(tests[0]), - tests + tests, + 0 }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/belr-5.2.51/tester/parser.cpp new/belr-5.2.98/tester/parser.cpp --- old/belr-5.2.51/tester/parser.cpp 2023-02-23 18:42:08.000000000 +0100 +++ new/belr-5.2.98/tester/parser.cpp 2023-07-27 15:58:13.000000000 +0200 @@ -301,5 +301,6 @@ NULL, NULL, sizeof(tests) / sizeof(tests[0]), - tests + tests, + 0 }; ++++++ set_current_version.patch ++++++ --- belr-5.2.98/CMakeLists.txt.orig 2023-08-28 10:11:45.505481273 +0200 +++ belr-5.2.98/CMakeLists.txt 2023-08-28 10:11:53.068859241 +0200 @@ -29,7 +29,7 @@ cmake_policy(SET CMP0077 NEW) endif() -project(BELR VERSION 5.2.0 LANGUAGES C CXX) +project(BELR VERSION 5.2.98 LANGUAGES C CXX) set(BELR_SO_VERSION "1")