MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / pthread_kill

Function pthread_kill

components/libc/posix/pthreads/pthread.c:1093–1115  ·  view source on GitHub ↗

* @brief Sends a signal to a specific thread. * * The `pthread_kill` function sends the specified signal to the target thread. This allows fine-grained * control over signal handling in multithreaded applications. * * @param[in] thread * The target thread to which the signal is sent. This is a valid `pthread_t` identifier. * * @param[in] sig * The signal to be sent. This can be any va

Source from the content-addressed store, hash-verified

1091 * @see pthread_sigmask, sigaction
1092 */
1093int pthread_kill(pthread_t thread, int sig)
1094{
1095#ifdef RT_USING_SIGNALS
1096 _pthread_data_t *ptd;
1097 int ret;
1098
1099 ptd = _pthread_get_data(thread);
1100 if (ptd)
1101 {
1102 ret = rt_thread_kill(ptd->tid, sig);
1103 if (ret == -RT_EINVAL)
1104 {
1105 return EINVAL;
1106 }
1107
1108 return ret;
1109 }
1110
1111 return ESRCH;
1112#else
1113 return ENOSYS;
1114#endif
1115}
1116RTM_EXPORT(pthread_kill);
1117
1118#ifdef RT_USING_SIGNALS

Callers 1

rt_hw_interrupt_enableFunction · 0.85

Calls 2

_pthread_get_dataFunction · 0.85
rt_thread_killFunction · 0.85

Tested by

no test coverage detected