MCPcopy Create free account
hub / github.com/NetSys/bess / Start

Method Start

core/utils/syscallthread.h:165–185  ·  view source on GitHub ↗

! * Starts the thread running. Will call the user provided Run() * once it's ready (unless the thread was already asked to exit). * * Returns true on success, false (with errno set) on failure. */

Source from the content-addressed store, hash-verified

163 * Returns true on success, false (with errno set) on failure.
164 */
165 bool Start() {
166 // Establish process-wide signal catching, if that isn't
167 // yet done. The signal handler will interrupt system calls.
168 if (!CatchExitSignal()) {
169 return false;
170 }
171
172 // If the thread isn't in pristine state, this is an error.
173 if (state_ != ThreadState::kNotStarted) {
174 errno = EINVAL;
175 return false;
176 }
177
178 assert(!thread_.joinable());
179 AssertNoKnockThread();
180
181 state_ = ThreadState::kStarting;
182 thread_ = std::thread(RunInThread, this, reliable_);
183
184 return true;
185 }
186
187 /*
188 * Requests that the thread, if started, terminate. Optionally

Callers 2

StartThreadLockedMethod · 0.80
InitMethod · 0.80

Calls 1

CatchExitSignalFunction · 0.85

Tested by

no test coverage detected