From 31191dc3f7679bc50cf72fb414ab786172fef24b Mon Sep 17 00:00:00 2001 From: oblivion Date: Thu, 26 Sep 2019 07:50:11 +0000 Subject: [PATCH] SSH: Core::Wait() is moved out of the critical section. (MT fix) git-svn-id: svn://ultimatepp.org/upp/trunk@13617 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/SSH/Core.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/uppsrc/Core/SSH/Core.cpp b/uppsrc/Core/SSH/Core.cpp index be27ac352..c30572823 100644 --- a/uppsrc/Core/SSH/Core.cpp +++ b/uppsrc/Core/SSH/Core.cpp @@ -68,10 +68,7 @@ bool Ssh::Do(Gate<>& fn) Check(); if(!ssh->init) ssh->init = Init(); - if(ssh->init && fn()) - return false; - Wait(); - return true; + return !ssh->init || !fn(); } bool Ssh::Run(Gate<>&& fn) @@ -81,7 +78,7 @@ bool Ssh::Run(Gate<>&& fn) ssh->start_time = msecs(); while(Do(fn)) - ; + Wait(); ssh->status = IDLE; }