File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change 1212#include " cameron314/concurrentqueue.h"
1313#include " srsran/srslog/srslog.h"
1414
15+ #ifdef ENABLE_TSAN
16+ #include " sanitizer/tsan_interface.h"
17+ #endif
18+
1519using namespace srsran ;
1620
1721// / Timer Wheel configuration parameters.
@@ -70,18 +74,30 @@ class timer_manager::unique_timer_pool
7074public:
7175 unique_timer_pool (timer_manager& parent, unsigned capacity) : free_list(capacity) {}
7276
73- void push (timer_manager::timer_frontend* obj) { free_list.enqueue (obj); }
77+ void push (timer_manager::timer_frontend* obj)
78+ {
79+ #ifdef ENABLE_TSAN
80+ __tsan_release ((void *)obj);
81+ #endif
82+ free_list.enqueue (obj);
83+ }
7484
7585 timer_manager::timer_frontend* pop ()
7686 {
7787 timer_manager::timer_frontend* ret;
7888 if (free_list.try_dequeue (ret)) {
89+ #ifdef ENABLE_TSAN
90+ __tsan_acquire ((void *)ret);
91+ #endif
7992 return ret;
8093 }
8194 return nullptr ;
8295 }
8396
84- size_t size_approx () const { return free_list.size_approx (); }
97+ size_t size_approx () const
98+ {
99+ return free_list.size_approx ();
100+ }
85101
86102private:
87103 // List of timer_handle objects in timer_list that are currently not allocated.
You can’t perform that action at this time.
0 commit comments