Bump osmium to version 2.20.0 (#6997)

This commit is contained in:
Siarhei Fedartsou
2024-09-28 20:35:05 +02:00
committed by GitHub
parent 676f6d4704
commit 09a716a9e5
278 changed files with 1007 additions and 1015 deletions
@@ -5,7 +5,7 @@
This file is part of Osmium (https://osmcode.org/libosmium).
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
Boost Software License - Version 1.0 - August 17th, 2003
+2 -2
View File
@@ -5,7 +5,7 @@
This file is part of Osmium (https://osmcode.org/libosmium).
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
Boost Software License - Version 1.0 - August 17th, 2003
@@ -66,7 +66,7 @@ namespace osmium {
}
if (num_threads < 0) {
num_threads += int(hardware_concurrency);
num_threads += static_cast<int>(hardware_concurrency);
}
if (num_threads < 1) {
+6 -6
View File
@@ -5,7 +5,7 @@
This file is part of Osmium (https://osmcode.org/libosmium).
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
Boost Software License - Version 1.0 - August 17th, 2003
@@ -165,7 +165,7 @@ namespace osmium {
#endif
}
}
std::lock_guard<std::mutex> lock{m_mutex};
const std::lock_guard<std::mutex> lock{m_mutex};
m_queue.push(std::move(value));
#ifdef OSMIUM_DEBUG_QUEUE_SIZE
if (m_largest_size < m_queue.size()) {
@@ -203,7 +203,7 @@ namespace osmium {
++m_pop_counter;
#endif
{
std::lock_guard<std::mutex> lock{m_mutex};
const std::lock_guard<std::mutex> lock{m_mutex};
if (m_queue.empty()) {
#ifdef OSMIUM_DEBUG_QUEUE_SIZE
++m_empty_counter;
@@ -220,12 +220,12 @@ namespace osmium {
}
bool empty() const {
std::lock_guard<std::mutex> lock{m_mutex};
const std::lock_guard<std::mutex> lock{m_mutex};
return m_queue.empty();
}
std::size_t size() const {
std::lock_guard<std::mutex> lock{m_mutex};
const std::lock_guard<std::mutex> lock{m_mutex};
return m_queue.size();
}
@@ -235,7 +235,7 @@ namespace osmium {
void shutdown() {
m_in_use = false;
std::lock_guard<std::mutex> lock{m_mutex};
const std::lock_guard<std::mutex> lock{m_mutex};
while (!m_queue.empty()) {
m_queue.pop();
}
+10 -4
View File
@@ -5,7 +5,7 @@
This file is part of Osmium (https://osmcode.org/libosmium).
Copyright 2013-2022 Jochen Topf <jochen@topf.org> and others (see README).
Copyright 2013-2023 Jochen Topf <jochen@topf.org> and others (see README).
Boost Software License - Version 1.0 - August 17th, 2003
@@ -38,8 +38,10 @@ DEALINGS IN THE SOFTWARE.
#include <thread>
#include <utility>
#ifdef __linux__
#if defined(__linux__)
# include <sys/prctl.h>
#elif defined(__FreeBSD__)
# include <pthread.h>
#endif
namespace osmium {
@@ -70,12 +72,16 @@ namespace osmium {
}
/**
* Set name of current thread for debugging. This only works on Linux.
* Set name of current thread for debugging. This currently only works on Linux and FreeBSD.
*/
#ifdef __linux__
#if defined(__linux__)
inline void set_thread_name(const char* name) noexcept {
prctl(PR_SET_NAME, name, 0, 0, 0);
}
#elif defined(__FreeBSD__)
inline void set_thread_name(const char* name) noexcept {
pthread_setname_np(pthread_self(), name);
}
#else
inline void set_thread_name(const char*) noexcept {
// intentionally left blank