summaryrefslogtreecommitdiffstats
path: root/lib/librt/mq.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-03-04 00:18:19 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-03-04 00:18:19 +0000
commit8e36ba772a0d4c7556d1b618bc0485c97cae37a7 (patch)
tree17f6e8e0534f23d8bcdda95b7377ff0aca417da9 /lib/librt/mq.c
parent2399d185fc6ba76a6630ecae4436a11772a3973e (diff)
downloadFreeBSD-src-8e36ba772a0d4c7556d1b618bc0485c97cae37a7.zip
FreeBSD-src-8e36ba772a0d4c7556d1b618bc0485c97cae37a7.tar.gz
Use a thread pool to process notification if sigev_notify_attributes
is default and caller does not require dedicated thread. timer needs a dedicated thread to maintain overrun count correctly in notification context. mqueue and aio can use thread pool to do notification concurrently, the thread pool has lifecycle control, some threads will exit if they have idled for a while.
Diffstat (limited to 'lib/librt/mq.c')
-rw-r--r--lib/librt/mq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/librt/mq.c b/lib/librt/mq.c
index 5950de8..ff46b25 100644
--- a/lib/librt/mq.c
+++ b/lib/librt/mq.c
@@ -119,7 +119,7 @@ __mq_close(mqd_t mqd)
typedef void (*mq_func)(union sigval val);
static void
-mq_dispatch(struct sigev_node *sn, siginfo_t *si)
+mq_dispatch(struct sigev_node *sn)
{
mq_func f = sn->sn_func;
@@ -127,7 +127,7 @@ mq_dispatch(struct sigev_node *sn, siginfo_t *si)
* Check generation before calling user function,
* this should avoid expired notification.
*/
- if (sn->sn_gen == si->si_value.sival_int)
+ if (sn->sn_gen == sn->sn_info.si_value.sival_int)
f(sn->sn_value);
}
@@ -156,7 +156,7 @@ __mq_notify(mqd_t mqd, const struct sigevent *evp)
return (-1);
}
- sn = __sigev_alloc(SI_MESGQ, evp);
+ sn = __sigev_alloc(SI_MESGQ, evp, mqd->node, 1);
if (sn == NULL) {
errno = EAGAIN;
return (-1);
OpenPOWER on IntegriCloud