From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 076F43870884; Mon, 21 Dec 2020 20:37:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 076F43870884 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/iains/heads/d-for-darwin)] D, Darwin : Do not allow moving fibres between pthreads. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/users/iains/heads/d-for-darwin X-Git-Oldrev: ba1f63c1c382abb0ff868dddfbdb1dd066f1e57b X-Git-Newrev: 73a03aaca5be37a6de554603dc7a046b6614fda2 Message-Id: <20201221203708.076F43870884@sourceware.org> Date: Mon, 21 Dec 2020 20:37:08 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2020 20:37:08 -0000 https://gcc.gnu.org/g:73a03aaca5be37a6de554603dc7a046b6614fda2 commit 73a03aaca5be37a6de554603dc7a046b6614fda2 Author: Iain Sandoe Date: Thu Dec 10 14:06:07 2020 +0000 D, Darwin : Do not allow moving fibres between pthreads. Emulated TLS targets (and, indeed some native TLS ones too) on GCC should not allow fibres to be moved between threads since the ME keeps pointers to TLS vars cached as an internal detail and cannot see that a function call could return on a different thread. Diff: --- libphobos/libdruntime/core/thread.d | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libphobos/libdruntime/core/thread.d b/libphobos/libdruntime/core/thread.d index 5381cda103b..843125831aa 100644 --- a/libphobos/libdruntime/core/thread.d +++ b/libphobos/libdruntime/core/thread.d @@ -5311,6 +5311,11 @@ unittest // Multiple threads running shared fibers version (PPC) version = UnsafeFiberMigration; version (PPC64) version = UnsafeFiberMigration; +version (Darwin) +{ + version (X86) version = UnsafeFiberMigration; + version (X86_64) version = UnsafeFiberMigration; +} version (UnsafeFiberMigration) {