mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 10:32:47 +08:00
signals: Adds a very limited, minimal implementation for SIGEV_THREAD
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
|
||||
#if defined(CONFIG_SIG_EVTHREAD) && defined(__KERNEL__)
|
||||
#if defined(CONFIG_SIG_EVTHREAD) && defined(CONFIG_BUILD_FLAT)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
@@ -72,5 +72,5 @@
|
||||
|
||||
int sig_notification(pid_t pid, FAR struct sigevent *event);
|
||||
|
||||
#endif /* CONFIG_SIG_EVTHREAD && __KERNEL__ */
|
||||
#endif /* CONFIG_SIG_EVTHREAD && CONFIG_BUILD_FLAT */
|
||||
#endif /* __INCLUDE_NUTTX_SIGNAL_H */
|
||||
|
||||
@@ -432,6 +432,10 @@ int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset);
|
||||
}
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
* Minimal Type Definitions
|
||||
********************************************************************************/
|
||||
|
||||
#else /* __INCLUDE_PTHREAD_H */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
+12
-6
@@ -210,6 +210,12 @@ union sigval
|
||||
* available on a queue
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_CAN_PASS_STRUCTS
|
||||
typedef CODE void (*sigev_notify_function_t)(union sigval value);
|
||||
#else
|
||||
typedef CODE void (*sigev_notify_function_t)(FAR void *sival_ptr);
|
||||
#endif
|
||||
|
||||
struct sigevent
|
||||
{
|
||||
uint8_t sigev_notify; /* Notification method: SIGEV_SIGNAL, SIGEV_NONE, or SIGEV_THREAD */
|
||||
@@ -217,8 +223,8 @@ struct sigevent
|
||||
union sigval sigev_value; /* Data passed with notification */
|
||||
|
||||
#ifdef CONFIG_SIG_EVTHREAD
|
||||
CODE void (*sigev_notify_function)(union sigval); /* Notification function */
|
||||
FAR pthread_attr_t *sigev_notify_attributes; /* Notification attributes (not used) */
|
||||
sigev_notify_function_t sigev_notify_function; /* Notification function */
|
||||
FAR pthread_attr_t *sigev_notify_attributes; /* Notification attributes (not used) */
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -264,10 +270,6 @@ struct sigaction
|
||||
#define sa_handler sa_u._sa_handler
|
||||
#define sa_sigaction sa_u._sa_sigaction
|
||||
|
||||
/********************************************************************************
|
||||
* Public Data
|
||||
********************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
* Public Function Prototypes
|
||||
********************************************************************************/
|
||||
@@ -310,6 +312,10 @@ int sigqueue(int pid, int signo, FAR void *sival_ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
* Minimal Type Definitions
|
||||
********************************************************************************/
|
||||
|
||||
#else /* __INCLUDE_SIGNAL_H */
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
Reference in New Issue
Block a user