FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Disruptor-cpp/Disruptor.Tests/WaitStrategyTestUtil.cpp at master · githubCode3a/Disruptor-cpp · GitHub
githubCode3a
/
Disruptor-cpp
Public
forked from
Abc-Arbitrage/Disruptor-cpp
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Disruptor-cpp
/
Disruptor.Tests
/
WaitStrategyTestUtil.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (22 loc) · 882 Bytes
Breadcrumbs
Disruptor-cpp
/
Disruptor.Tests
/
WaitStrategyTestUtil.cpp
Copy path
File metadata and controls
29 lines (22 loc) · 882 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#
include
"
stdafx.h
"
#
include
"
WaitStrategyTestUtil.h
"
#
include
"
Disruptor/IWaitStrategy.h
"
#
include
"
Disruptor/Sequence.h
"
#
include
"
DummySequenceBarrier.h
"
#
include
"
SequenceUpdater.h
"
namespace
Disruptor
{
namespace
Tests
{
void
assertWaitForWithDelayOf
(std::
int64_t
sleepTimeMillis,
const
std::shared_ptr< IWaitStrategy >& waitStrategy)
{
auto
sequencerUpdater = std::make_shared< SequenceUpdater >(sleepTimeMillis, waitStrategy);
std::thread
([=] { sequencerUpdater->
run
(); }).
detach
();
sequencerUpdater->
waitForStartup
();
auto
cursor = std::make_shared< Sequence >(
0
);
auto
barrier = std::make_shared< DummySequenceBarrier >();
auto
sequence = waitStrategy->
waitFor
(
0
, *cursor, *sequencerUpdater->
sequence
, *barrier);
BOOST_CHECK_EQUAL
(sequence,
0L
);
}
}
//
namespace Tests
}
//
namespace Disruptor
Back
|
FazBrowse Home
|
New Git URL