mirror of https://github.com/PentHertz/srsLTE.git
- Use fprintf in the srsran_assert context incase the assert is being triggered by srslog producing a circular loop.
- Switch to use a dynamic circular buffer for the log backend queue.
This commit is contained in:
parent
4b5e15cd70
commit
3c1a97f450
|
@ -13,8 +13,8 @@
|
||||||
#ifndef SRSRAN_ASSERT_H
|
#ifndef SRSRAN_ASSERT_H
|
||||||
#define SRSRAN_ASSERT_H
|
#define SRSRAN_ASSERT_H
|
||||||
|
|
||||||
#include "srsran/common/standard_streams.h"
|
|
||||||
#include "srsran/srslog/srslog.h"
|
#include "srsran/srslog/srslog.h"
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
#ifdef ASSERTS_ENABLED
|
#ifdef ASSERTS_ENABLED
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@
|
||||||
#define srsran_assert(condition, fmt, ...) \
|
#define srsran_assert(condition, fmt, ...) \
|
||||||
do { \
|
do { \
|
||||||
if (srsran_unlikely(not(condition))) { \
|
if (srsran_unlikely(not(condition))) { \
|
||||||
|
std::fprintf(stderr, "%s:%d: " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__); \
|
||||||
std::abort(); \
|
std::abort(); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
|
@ -27,12 +27,12 @@ namespace detail {
|
||||||
template <typename T, size_t capacity = SRSLOG_QUEUE_CAPACITY>
|
template <typename T, size_t capacity = SRSLOG_QUEUE_CAPACITY>
|
||||||
class work_queue
|
class work_queue
|
||||||
{
|
{
|
||||||
srsran::static_circular_buffer<T, capacity> queue;
|
srsran::dyn_circular_buffer<T> queue;
|
||||||
mutable condition_variable cond_var;
|
mutable condition_variable cond_var;
|
||||||
static constexpr size_t threshold = capacity * 0.98;
|
static constexpr size_t threshold = capacity * 0.98;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
work_queue() = default;
|
work_queue() : queue(capacity) {}
|
||||||
|
|
||||||
work_queue(const work_queue&) = delete;
|
work_queue(const work_queue&) = delete;
|
||||||
work_queue& operator=(const work_queue&) = delete;
|
work_queue& operator=(const work_queue&) = delete;
|
||||||
|
|
Loading…
Reference in New Issue