Assert on (! shutdown_), function schedule_from_remote
- Lenguaje dominante
- C++
- Estrellas
- 510
- Forks
- 123
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
While investigating another case just found this assert fired.
Boost fiber from develop branch.
The toy example to reproduce (some time it needs several runs):
```cpp
#include
#include
#include
#include
#include
using namespace std::chrono_literals;
int main()
{
boost::fibers::mutex mtx;
boost::fibers::condition_variable cond;
std::atomic stopping;
std::vector pool;
for (size_t i = 0; i < 10; i++)
{
auto th = std::thread([&] ()
{
boost::fibers::use_scheduling_algorithm();
auto f1 = boost::fibers::fiber([&] () {
int i = 0;
while (!stopping.load())
{
std::cout << "trying to get lock" << std::endl;
std::unique_lock l(mtx);
std::this_thread::sleep_for(100ms);
std::cout << i++ << " waiting" << std::endl;
cond.wait_for(l, 15ms);
std::cout << "worker" << std::endl;
}
});
f1.join();
});
pool.push_back(std::move(th));
}
auto th2 = std::thread([&] ()
{
while (!stopping.load())
{
{
std::unique_lock l(mtx);
cond.notify_all();
}
std::this_thread::sleep_for(1ms);
}
});
std::this_thread::sleep_for(200ms);
stopping.store(true);
for (auto& th : pool)
{
th.join();
}
th2.join();
return 0;
}
```
possible output:
```
trying to get lock
trying to get lock
trying to get lock
trying to get lock
trying to get lock
trying to get lock
trying to get lock
trying to get lock
trying to get lock
trying to get lock
0 waiting
0 waiting
0 waiting
worker
0 waiting
0 waiting
0 waiting
0 waiting
Assertion failed: (! shutdown_), function schedule_from_remote, file libs/fiber/src/scheduler.cpp, line 227.
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.