| 214 | #endif |
| 215 | |
| 216 | static inline int ff_thread_setname(const char *name) |
| 217 | { |
| 218 | int ret = 0; |
| 219 | |
| 220 | #if HAVE_PRCTL |
| 221 | ret = AVERROR(prctl(PR_SET_NAME, name)); |
| 222 | #elif HAVE_PTHREAD_SETNAME_NP |
| 223 | #if defined(__APPLE__) |
| 224 | ret = AVERROR(pthread_setname_np(name)); |
| 225 | #elif defined(__NetBSD__) |
| 226 | ret = AVERROR(pthread_setname_np(pthread_self(), "%s", name)); |
| 227 | #else |
| 228 | ret = AVERROR(pthread_setname_np(pthread_self(), name)); |
| 229 | #endif |
| 230 | #elif HAVE_PTHREAD_SET_NAME_NP |
| 231 | pthread_set_name_np(pthread_self(), name); |
| 232 | #elif HAVE_W32THREADS |
| 233 | ret = win32_thread_setname(name); |
| 234 | #else |
| 235 | ret = AVERROR(ENOSYS); |
| 236 | #endif |
| 237 | |
| 238 | return ret; |
| 239 | } |
| 240 | |
| 241 | #endif /* AVUTIL_THREAD_H */ |
no test coverage detected