From 145fdbf3b271c296680a4ecb53605bcb95c10662 Mon Sep 17 00:00:00 2001 From: Tommi Date: Fri, 8 Apr 2022 12:41:25 +0200 Subject: [PATCH] Explicitly disallow copy in PlatformThread Bug: none Change-Id: If7a7483f742ef5650b991ad659265a598b91a892 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258400 Commit-Queue: Tomas Gunnarsson Reviewed-by: Markus Handell Commit-Queue: Markus Handell Cr-Commit-Position: refs/heads/main@{#36494} --- rtc_base/platform_thread.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rtc_base/platform_thread.h b/rtc_base/platform_thread.h index 2c82c02455..3ab2761f43 100644 --- a/rtc_base/platform_thread.h +++ b/rtc_base/platform_thread.h @@ -55,6 +55,10 @@ class PlatformThread final { // removed. PlatformThread(PlatformThread&& rhs); + // Copies won't work since we'd have problems with joinable threads. + PlatformThread(const PlatformThread&) = delete; + PlatformThread& operator=(const PlatformThread&) = delete; + // Moves `rhs` into this, storing an empty state in `rhs`. // TODO(bugs.webrtc.org/12727) Look into if default and move support can be // removed.