<p><b>@lonvia</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/osm2pgsql/pull/960#discussion_r334882768">db-copy.cpp</a>:</p>
<pre style='color:#555'>> @@ -28,9 +28,18 @@ db_copy_thread_t::~db_copy_thread_t() { finish(); }
 void db_copy_thread_t::add_buffer(std::unique_ptr<db_cmd_t> &&buffer)
 {
     assert(m_worker.joinable()); // thread must not have been finished
-    std::unique_lock<std::mutex> lock(m_queue_mutex);
-    m_worker_queue.push_back(std::move(buffer));
-    m_queue_cond.notify_one();
+
+    for (;;) {
+        std::unique_lock<std::mutex> lock(m_queue_mutex);
+        if (m_worker_queue.size() >= db_cmd_copy_t::Max_buffers) {
+            m_queue_full_cond.wait(lock);
</pre>
<p>Changed that for both condition variables.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/pull/960?email_source=notifications&email_token=AA6353QC6IHQXCCY6VI5ZYDQOWOR7A5CNFSM4JATFEWKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCH6WDKA#discussion_r334882768">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353QGWYSFRWF2FEQITYLQOWOR7ANCNFSM4JATFEWA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353ULTMHL5DN5UCVCZYLQOWOR7A5CNFSM4JATFEWKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCH6WDKA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/pull/960?email_source=notifications\u0026email_token=AA6353QC6IHQXCCY6VI5ZYDQOWOR7A5CNFSM4JATFEWKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCH6WDKA#discussion_r334882768",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/960?email_source=notifications\u0026email_token=AA6353QC6IHQXCCY6VI5ZYDQOWOR7A5CNFSM4JATFEWKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCH6WDKA#discussion_r334882768",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>