Skip to content

Commit ee978f3

Browse files
committed
Revert unrelated changes
Signed-off-by: JCW <[email protected]>
1 parent f828065 commit ee978f3

File tree

8 files changed

+15
-95
lines changed

8 files changed

+15
-95
lines changed

cmake/RippledCore.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ target_link_libraries(xrpl.libxrpl.basics PUBLIC xrpl.libxrpl.beast)
8585
add_module(xrpl json)
8686
target_link_libraries(xrpl.libxrpl.json PUBLIC xrpl.libxrpl.basics)
8787

88-
8988
add_module(xrpl crypto)
9089
target_link_libraries(xrpl.libxrpl.crypto PUBLIC xrpl.libxrpl.basics)
9190

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Xrpl(ConanFile):
2929
'nudb/2.0.9',
3030
'openssl/3.5.2',
3131
'soci/4.0.3',
32-
'zlib/1.3.1'
32+
'zlib/1.3.1',
3333
]
3434

3535
test_requires = [

include/xrpl/beast/utility/Journal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ enum Severity {
313313
kNone = kDisabled
314314
};
315315

316-
std::string
316+
std::string_view
317317
to_string(Severity severity);
318318
} // namespace severities
319319

src/libxrpl/beast/utility/beast_Journal.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,29 +94,30 @@ Journal::getNullSink()
9494

9595
//------------------------------------------------------------------------------
9696

97-
std::string
97+
std::string_view
9898
severities::to_string(Severity severity)
9999
{
100+
using namespace std::string_view_literals;
100101
switch (severity)
101102
{
102103
case kDisabled:
103-
return "disabled";
104+
return "disabled"sv;
104105
case kTrace:
105-
return "trace";
106+
return "trace"sv;
106107
case kDebug:
107-
return "debug";
108+
return "debug"sv;
108109
case kInfo:
109-
return "info";
110+
return "info"sv;
110111
case kWarning:
111-
return "warning";
112+
return "warning"sv;
112113
case kError:
113-
return "error";
114+
return "error"sv;
114115
case kFatal:
115-
return "fatal";
116+
return "fatal"sv;
116117
default:
117118
UNREACHABLE("Unexpected severity value!");
118119
}
119-
return "";
120+
return ""sv;
120121
}
121122

122123
void

src/test/core/Coroutine_test.cpp

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -175,74 +175,12 @@ class Coroutine_test : public beast::unit_test::suite
175175
BEAST_EXPECT(*lv == -1);
176176
}
177177

178-
void
179-
test_yield_and_stop()
180-
{
181-
using namespace std::chrono_literals;
182-
using namespace jtx;
183-
184-
testcase("yield and stop");
185-
186-
Env env(*this, envconfig([](std::unique_ptr<Config> cfg) {
187-
cfg->FORCE_MULTI_THREAD = true;
188-
return cfg;
189-
}));
190-
191-
std::shared_ptr<JobQueue::Coro> c;
192-
std::mutex mutexStop;
193-
std::mutex mutexYield;
194-
std::condition_variable cond;
195-
std::condition_variable condYield;
196-
bool yielded = false;
197-
bool stopped = false;
198-
199-
env.app().getJobQueue().postCoro(
200-
jtCLIENT, "Coroutine-Test", [&](auto const& cr) {
201-
c = cr;
202-
{
203-
std::unique_lock lock(mutexYield);
204-
yielded = true;
205-
condYield.notify_all();
206-
}
207-
c->yield();
208-
// Just to keep this job alive
209-
std::this_thread::sleep_for(5ms);
210-
});
211-
std::thread th{[&]() {
212-
std::unique_lock lock(mutexStop);
213-
cond.wait(lock, [&]() { return stopped; });
214-
// Delay a bit to wait for stop() to be called
215-
std::this_thread::sleep_for(1ms);
216-
c->post();
217-
}};
218-
219-
// Delay a bit to wait for yield() to be called
220-
std::this_thread::sleep_for(1ms);
221-
std::unique_lock lockYield(mutexYield);
222-
condYield.wait(lockYield, [&]() { return yielded; });
223-
{
224-
std::unique_lock lock(mutexStop);
225-
stopped = true;
226-
cond.notify_all();
227-
}
228-
env.app().getJobQueue().stop();
229-
try
230-
{
231-
th.join();
232-
}
233-
catch (std::exception const& e)
234-
{
235-
}
236-
pass();
237-
}
238-
239178
void
240179
run() override
241180
{
242181
correct_order();
243182
incorrect_order();
244183
thread_specific_storage();
245-
// test_yield_and_stop();
246184
}
247185
};
248186

src/xrpld/core/ClosureCounter.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,6 @@ class ClosureCounter
180180
}
181181
}
182182

183-
template <class Closure>
184-
Substitute<Closure>
185-
forceWrap(Closure&& closure)
186-
{
187-
return {*this, std::forward<Closure>(closure)};
188-
}
189-
190183
/** Wrap the passed closure with a reference counter.
191184
192185
@param closure Closure that accepts Args_t parameters and returns Ret_t.

src/xrpld/core/Coro.ipp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ JobQueue::Coro::resume()
9898
}
9999
{
100100
std::lock_guard lock(jq_.m_mutex);
101-
102-
XRPL_ASSERT(
103-
jq_.nSuspend_ > 0,
104-
"ripple::JobQueue::Coro::resume jq_.nSuspend_ should be greater "
105-
"than 0");
106101
--jq_.nSuspend_;
107102
}
108103
auto saved = detail::getLocalValues().release();
@@ -139,11 +134,6 @@ JobQueue::Coro::expectEarlyExit()
139134
// That said, since we're outside the Coro's stack, we need to
140135
// decrement the nSuspend that the Coro's call to yield caused.
141136
std::lock_guard lock(jq_.m_mutex);
142-
143-
XRPL_ASSERT(
144-
jq_.nSuspend_ > 0,
145-
"ripple::JobQueue::Coro::expectEarlyExit() jq_.nSuspend_ should be "
146-
"greater than 0");
147137
--jq_.nSuspend_;
148138
#ifndef NDEBUG
149139
finished_ = true;

src/xrpld/core/detail/JobQueue.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,9 @@ JobQueue::stop()
304304
// but there may still be some threads between the return of
305305
// `Job::doJob` and the return of `JobQueue::processTask`. That is why
306306
// we must wait on the condition variable to make these assertions.
307-
std::unique_lock lock(m_mutex);
308-
cv_.wait(lock, [this] {
309-
return m_processCount == 0 && nSuspend_ == 0 && m_jobSet.empty();
310-
});
307+
std::unique_lock<std::mutex> lock(m_mutex);
308+
cv_.wait(
309+
lock, [this] { return m_processCount == 0 && m_jobSet.empty(); });
311310
XRPL_ASSERT(
312311
m_processCount == 0,
313312
"ripple::JobQueue::stop : all processes completed");

0 commit comments

Comments
 (0)