aboutsummaryrefslogtreecommitdiff
path: root/src/util/container.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-09-17 18:14:25 +0200
committerGitHub <noreply@github.com>2021-09-17 18:14:25 +0200
commitfd8a8501bc26dfca2a93d51000867b8592210040 (patch)
tree2555456796bc15f7ef0f2bc24c08b9848b874b4e /src/util/container.h
parentea250ff5c57301b6ea3e529c811484c743c1fde1 (diff)
downloaddragonfireclient-fd8a8501bc26dfca2a93d51000867b8592210040.tar.xz
Shave off buffer copies in networking code (#11607)
Diffstat (limited to 'src/util/container.h')
-rw-r--r--src/util/container.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/container.h b/src/util/container.h
index 1c4a219f0..001066563 100644
--- a/src/util/container.h
+++ b/src/util/container.h
@@ -140,6 +140,13 @@ public:
m_signal.post();
}
+ void push_back(T &&t)
+ {
+ MutexAutoLock lock(m_mutex);
+ m_queue.push_back(std::move(t));
+ m_signal.post();
+ }
+
/* this version of pop_front returns a empty element of T on timeout.
* Make sure default constructor of T creates a recognizable "empty" element
*/