summaryrefslogtreecommitdiffstats
path: root/tpool/tpool_structs.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
commit86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch)
tree28c9e526ea739c6f9b89e36115e1e2698bddf981 /tpool/tpool_structs.h
parentReleasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff)
downloadmariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz
mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tpool/tpool_structs.h')
-rw-r--r--tpool/tpool_structs.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/tpool/tpool_structs.h b/tpool/tpool_structs.h
index 099ae5c7..ff3228c9 100644
--- a/tpool/tpool_structs.h
+++ b/tpool/tpool_structs.h
@@ -155,12 +155,11 @@ public:
{
mysql_mutex_lock(&m_mtx);
assert(!is_full());
+ const bool was_empty= is_empty();
// put element to the logical end of the array
m_cache[--m_pos] = ele;
- /* Notify waiters when the cache becomes
- not empty, or when it becomes full */
- if (m_pos == 1 || (m_waiters && is_full()))
+ if (was_empty || (is_full() && m_waiters))
pthread_cond_broadcast(&m_cv);
mysql_mutex_unlock(&m_mtx);
}