Skip to content

Commit

Permalink
[sshfs] Yield and move include
Browse files Browse the repository at this point in the history
  • Loading branch information
Sploder12 committed Dec 17, 2024
1 parent 2c6bbdb commit 5a8e954
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform/platform_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <multipass/format.h>
#include <multipass/platform.h>
#include <multipass/platform_unix.h>
#include <multipass/timer.h>
#include <multipass/utils.h>

#include <grp.h>
Expand All @@ -25,7 +26,6 @@
#include <unistd.h>

#include <libssh/sftp.h>
#include <multipass/timer.h>

namespace mp = multipass;

Expand Down
4 changes: 4 additions & 0 deletions tests/unix/test_platform_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <multipass/format.h>
#include <multipass/platform.h>

#include <thread>

namespace mp = multipass;
namespace mpt = multipass::test;

Expand Down Expand Up @@ -262,8 +264,10 @@ TEST_F(TestPlatformUnix, quit_watchdog_signals_itself_asynchronously)
EXPECT_CALL(*mock_signals, wait(_, _))
.WillRepeatedly(DoAll(
[&signaled, &times] {
// busy wait until signaled
while (!signaled.load(std::memory_order_acquire))
{
std::this_thread::yield();
}
times.fetch_add(1, std::memory_order_release);
signaled.store(false, std::memory_order_release);
Expand Down

0 comments on commit 5a8e954

Please sign in to comment.