mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 08:11:08 +00:00
(notify_func_wrapper): Wrapper function to call thread event callback function. (__aio_notify_only): Use function above.
This commit is contained in:
parent
dee6b86d37
commit
ed2d7a57e5
@ -1,5 +1,5 @@
|
|||||||
/* Notify initiator of AIO request.
|
/* Notify initiator of AIO request.
|
||||||
Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
|
Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||||
|
|
||||||
@ -23,6 +23,16 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "aio_misc.h"
|
#include "aio_misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
static void *
|
||||||
|
notify_func_wrapper (void *arg)
|
||||||
|
{
|
||||||
|
struct sigevent *sigev = arg;
|
||||||
|
sigev->sigev_notify_function (sigev->sigev_value);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
internal_function
|
internal_function
|
||||||
__aio_notify_only (struct sigevent *sigev, pid_t caller_pid)
|
__aio_notify_only (struct sigevent *sigev, pid_t caller_pid)
|
||||||
@ -44,9 +54,7 @@ __aio_notify_only (struct sigevent *sigev, pid_t caller_pid)
|
|||||||
pattr = &attr;
|
pattr = &attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pthread_create (&tid, pattr,
|
if (pthread_create (&tid, pattr, notify_func_wrapper, sigev) < 0)
|
||||||
(void *(*) (void *)) sigev->sigev_notify_function,
|
|
||||||
sigev->sigev_value.sival_ptr) < 0)
|
|
||||||
result = -1;
|
result = -1;
|
||||||
}
|
}
|
||||||
else if (sigev->sigev_notify == SIGEV_SIGNAL)
|
else if (sigev->sigev_notify == SIGEV_SIGNAL)
|
||||||
|
Loading…
Reference in New Issue
Block a user