mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 21:02:02 +08:00
WIP on fixing deadlock with BoostThreadWorker
This commit is contained in:
parent
c9de26daf7
commit
d1156ccefe
@ -118,7 +118,8 @@ public:
|
|||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
std::lock_guard lk{m_mutex};
|
std::lock_guard lk{m_mutex};
|
||||||
while (!m_queue.empty()) m_queue.pop();
|
while (!m_queue.empty())
|
||||||
|
m_queue.pop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,6 +18,6 @@ if (WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
# catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
||||||
set(_catch_args "exclude:[NotWorking]")
|
set(_catch_args "exclude:[NotWorking];-s")
|
||||||
list(APPEND _catch_args "${CATCH_EXTRA_ARGS}")
|
list(APPEND _catch_args "${CATCH_EXTRA_ARGS}")
|
||||||
add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests ${_catch_args})
|
add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests ${_catch_args})
|
||||||
|
@ -20,6 +20,14 @@ struct Progress: Slic3r::ProgressIndicator {
|
|||||||
|
|
||||||
using TestClasses = std::tuple< Slic3r::GUI::UIThreadWorker, Slic3r::GUI::BoostThreadWorker >;
|
using TestClasses = std::tuple< Slic3r::GUI::UIThreadWorker, Slic3r::GUI::BoostThreadWorker >;
|
||||||
|
|
||||||
|
TEMPLATE_LIST_TEST_CASE("Empty worker should not block when queried for idle", "[Jobs]", TestClasses) {
|
||||||
|
TestType worker{std::make_unique<Progress>()};
|
||||||
|
|
||||||
|
worker.wait_for_idle();
|
||||||
|
|
||||||
|
REQUIRE(worker.is_idle());
|
||||||
|
}
|
||||||
|
|
||||||
TEMPLATE_LIST_TEST_CASE("Empty worker should not do anything", "[Jobs]", TestClasses) {
|
TEMPLATE_LIST_TEST_CASE("Empty worker should not do anything", "[Jobs]", TestClasses) {
|
||||||
TestType worker{std::make_unique<Progress>()};
|
TestType worker{std::make_unique<Progress>()};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user