Skip to content

Commit 1795dcb

Browse files
committed
Function wait_and_pop_with_timeout() is not needed any more.
1 parent 4a3a71b commit 1795dcb

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

include/osmium/thread/pool.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ namespace osmium {
123123
osmium::thread::set_thread_name("_osmium_worker");
124124
while (true) {
125125
function_wrapper task;
126-
m_work_queue.wait_and_pop_with_timeout(task);
126+
m_work_queue.wait_and_pop(task);
127127
if (task) {
128128
if (task()) {
129129
// The called tasks returns true only when the

include/osmium/thread/queue.hpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -172,27 +172,6 @@ namespace osmium {
172172
}
173173
}
174174

175-
void wait_and_pop_with_timeout(T& value) {
176-
#ifdef OSMIUM_DEBUG_QUEUE_SIZE
177-
++m_pop_counter;
178-
#endif
179-
std::unique_lock<std::mutex> lock(m_mutex);
180-
#ifdef OSMIUM_DEBUG_QUEUE_SIZE
181-
if (m_queue.empty()) {
182-
++m_empty_counter;
183-
}
184-
#endif
185-
if (!m_data_available.wait_for(lock, std::chrono::seconds(1), [this] {
186-
return !m_queue.empty();
187-
})) {
188-
return;
189-
}
190-
if (!m_queue.empty()) {
191-
value = std::move(m_queue.front());
192-
m_queue.pop();
193-
}
194-
}
195-
196175
bool try_pop(T& value) {
197176
#ifdef OSMIUM_DEBUG_QUEUE_SIZE
198177
++m_pop_counter;

0 commit comments

Comments
 (0)