diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:33:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:33:02 +0000 |
commit | 4fa488fb0159c629483b7994aa84e73926b132b9 (patch) | |
tree | 182a19db69cdcb92be54cc6a5b0b9bfab28f80fd /tpool/tpool_structs.h | |
parent | Adding debian version 1:10.11.6-2. (diff) | |
download | mariadb-4fa488fb0159c629483b7994aa84e73926b132b9.tar.xz mariadb-4fa488fb0159c629483b7994aa84e73926b132b9.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.h | 5 |
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); } |