• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jbaldwin / libcoro / 10219129047

02 Aug 2024 04:47PM UTC coverage: 84.375% (-0.1%) from 84.498%
10219129047

Pull #272

github

web-flow
Merge c53f67690 into 5697678d7
Pull Request #272: Use lock for sync_wait completion

3 of 4 new or added lines in 1 file covered. (75.0%)

6 existing lines in 1 file now uncovered.

1377 of 1632 relevant lines covered (84.38%)

4240055.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

78.57
/src/sync_wait.cpp
1
#include "coro/sync_wait.hpp"
2

3
namespace coro::detail
4
{
5
sync_wait_event::sync_wait_event(bool initially_set) : m_set(initially_set)
6,000,115✔
6
{
7
}
6,000,115✔
8

9
auto sync_wait_event::set() noexcept -> void
6,000,115✔
10
{
11
    // issue-270 100~ task's on a thread_pool within sync_wait(when_all(tasks)) can cause a deadlock/hang if using
12
    // release/acquire or even seq_cst.
13
    m_set.exchange(true, std::memory_order::seq_cst);
6,000,115✔
14
    std::unique_lock<std::mutex> lk{m_mutex};
6,000,115✔
15
    m_cv.notify_all();
6,000,115✔
16
}
6,000,115✔
17

18
auto sync_wait_event::reset() noexcept -> void
×
19
{
NEW
20
    m_set.exchange(false, std::memory_order::seq_cst);
×
21
}
×
22

23
auto sync_wait_event::wait() noexcept -> void
6,000,115✔
24
{
25
    std::unique_lock<std::mutex> lk{m_mutex};
6,000,115✔
26
    m_cv.wait(lk, [this] { return m_set.load(std::memory_order::seq_cst); });
12,000,308✔
27
}
6,000,115✔
28

29
} // namespace coro::detail
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc