MCPcopy Create free account
hub / github.com/Haivision/srt / ThreadNameImpl

Method ThreadNameImpl

srtcore/threadname.h:116–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 }
115
116 explicit ThreadNameImpl(const std::string& name)
117 : reset(false)
118 {
119 tid = pthread_self();
120
121 if (!get(old_name))
122 return;
123
124 reset = set(name.c_str());
125 if (reset)
126 return;
127
128 // Try with a shorter name. 15 is the upper limit supported by Linux,
129 // other platforms should support a larger value. So 15 should works
130 // on all platforms.
131 const size_t max_len = 15;
132 if (name.size() > max_len)
133 reset = set(name.substr(0, max_len).c_str());
134 }
135
136 ~ThreadNameImpl()
137 {

Callers

nothing calls this directly

Calls 3

setFunction · 0.85
c_strMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected