MCPcopy Create free account
hub / github.com/apache/arrow / SendSignalToThread

Function SendSignalToThread

cpp/src/arrow/util/io_util.cc:2097–2113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2095}
2096
2097Status SendSignalToThread(int signum, uint64_t thread_id) {
2098#ifndef ARROW_ENABLE_THREADING
2099 return Status::NotImplemented("Can't send signal with no threads");
2100#elif defined(_WIN32)
2101 return Status::NotImplemented("Cannot send signal to specific thread on Windows");
2102#else
2103 // Have to use a C-style cast because pthread_t can be a pointer *or* integer type
2104 int r = pthread_kill((pthread_t)thread_id, signum); // NOLINT readability-casting
2105 if (r == 0) {
2106 return Status::OK();
2107 }
2108 if (r == EINVAL) {
2109 return Status::Invalid("Invalid signal number ", signum);
2110 }
2111 return IOErrorFromErrno(r, "Failed to raise signal");
2112#endif
2113}
2114
2115namespace {
2116

Callers 1

TEST_FFunction · 0.85

Calls 4

IOErrorFromErrnoFunction · 0.85
NotImplementedFunction · 0.50
OKFunction · 0.50
InvalidFunction · 0.50

Tested by 1

TEST_FFunction · 0.68