6 #if __cplusplus>=201103L 11 #define epicsExportSharedSymbols 31 Guard G(track->mutex);
32 track->refs.insert(
this);
42 track.reset(
new tracker);
43 Guard G(track->mutex);
44 track->refs.insert(
this);
55 Guard G(track->mutex);
56 track->refs.insert(
this);
65 Guard G(track->mutex);
66 track->refs.erase(
this);
69 #ifndef EXCEPT_USE_NONE 78 Guard G(track->mutex);
79 track->refs.insert(&o);
80 track->refs.erase(
this);
84 Guard G(track->mutex);
85 track->refs.insert(
this);
86 track->refs.erase(&o);
96 #ifndef EXCEPT_USE_NONE 101 #if defined(EXCEPT_USE_BACKTRACE) 114 #ifndef EXCEPT_USE_NONE 115 if(m_depth<=0)
return;
117 #if 0 && defined(EXCEPT_USE_BACKTRACE) 120 char **symbols=backtrace_symbols(m_stack, m_depth);
123 for(
int i=0;
i<m_depth;
i++) {
124 strm<<symbols[
i]<<
", ";
129 #elif !defined(EXCEPT_USE_NONE) 132 for(
int i=0;
i<m_depth;
i++) {
145 Guard G(track->mutex);
146 for(
auto ref : track->refs) {
147 if(!
self && ref==
this)
continue;
149 ref->show_stack(strm);
158 Guard G(track->mutex);
159 refs.insert(track->refs.begin(), track->refs.end());
165 #endif // __cplusplus>=201103L
void swap(shared_ptr_base &o)
void track_assign(const shared_ptr_base &o)
void show_refs(std::ostream &, bool self=true, bool weak=false) const
epicsGuard< epicsMutex > Guard
TODO only here because of the Lockable.
void spy_refs(ref_set_t &) const
std::set< const shared_ptr_base * > ref_set_t
APIs for the epicsMutex mutual exclusion semaphore.
void show_stack(std::ostream &) const