mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
aio: Remove support for BROKEN_THREAD_SIGNALS
This was originally added to support LinuxThreads and is not needed for NPTL.
This commit is contained in:
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
|||||||
|
2017-08-15 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
|
Remove BROKEN_THREAD_SIGNALS support for LinuxThreads.
|
||||||
|
* sysdeps/pthread/aio_misc.c (__aio_enqueue_request): Remove
|
||||||
|
BROKEN_THREAD_SIGNALS code.
|
||||||
|
* sysdeps/ppthread/aio_misc.h (struct waitlist, struct
|
||||||
|
request_list): Remove caller_pid member used for
|
||||||
|
BROKEN_THREAD_SIGNALS.
|
||||||
|
[BROKEN_THREAD_SIGNALS] (__aio_notify_only): Remove declaration.
|
||||||
|
* sysdeps/pthread/aio_notify.c (__aio_notify_only, __aio_notify):
|
||||||
|
Remove BROKEN_THREAD_SIGNALS support.
|
||||||
|
* sysdeps/pthread/aio_suspend.c (aio_suspend): Likewise.
|
||||||
|
* sysdeps/pthread/lio_listio.c (lio_listio_internal): Likewise.
|
||||||
|
|
||||||
2017-08-15 Florian Weimer <fweimer@redhat.com>
|
2017-08-15 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
* gmon/Makefile (tests): Add tst-gmon.
|
* gmon/Makefile (tests): Add tst-gmon.
|
||||||
|
@ -350,10 +350,6 @@ __aio_enqueue_request (aiocb_union *aiocbp, int operation)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
newp->aiocbp = aiocbp;
|
newp->aiocbp = aiocbp;
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
newp->caller_pid = (aiocbp->aiocb.aio_sigevent.sigev_notify == SIGEV_SIGNAL
|
|
||||||
? getpid () : 0);
|
|
||||||
#endif
|
|
||||||
newp->waiting = NULL;
|
newp->waiting = NULL;
|
||||||
|
|
||||||
aiocbp->aiocb.__abs_prio = prio;
|
aiocbp->aiocb.__abs_prio = prio;
|
||||||
|
@ -54,11 +54,6 @@ struct waitlist
|
|||||||
volatile unsigned int *counterp;
|
volatile unsigned int *counterp;
|
||||||
/* The next field is used in asynchronous `lio_listio' operations. */
|
/* The next field is used in asynchronous `lio_listio' operations. */
|
||||||
struct sigevent *sigevp;
|
struct sigevent *sigevp;
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
/* XXX See requestlist, it's used to work around the broken signal
|
|
||||||
handling in Linux. */
|
|
||||||
pid_t caller_pid;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -86,12 +81,6 @@ struct requestlist
|
|||||||
/* Pointer to the actual data. */
|
/* Pointer to the actual data. */
|
||||||
aiocb_union *aiocbp;
|
aiocb_union *aiocbp;
|
||||||
|
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
/* PID of the initiator thread.
|
|
||||||
XXX This is only necessary for the broken signal handling on Linux. */
|
|
||||||
pid_t caller_pid;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* List of waiting processes. */
|
/* List of waiting processes. */
|
||||||
struct waitlist *waiting;
|
struct waitlist *waiting;
|
||||||
};
|
};
|
||||||
@ -128,13 +117,8 @@ extern void __aio_notify (struct requestlist *req)
|
|||||||
attribute_hidden internal_function;
|
attribute_hidden internal_function;
|
||||||
|
|
||||||
/* Notify initiator of request. */
|
/* Notify initiator of request. */
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
extern int __aio_notify_only (struct sigevent *sigev, pid_t caller_pid)
|
|
||||||
attribute_hidden internal_function;
|
|
||||||
#else
|
|
||||||
extern int __aio_notify_only (struct sigevent *sigev)
|
extern int __aio_notify_only (struct sigevent *sigev)
|
||||||
attribute_hidden internal_function;
|
attribute_hidden internal_function;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Send the signal. */
|
/* Send the signal. */
|
||||||
extern int __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
|
extern int __aio_sigqueue (int sig, const union sigval val, pid_t caller_pid)
|
||||||
|
@ -49,11 +49,7 @@ notify_func_wrapper (void *arg)
|
|||||||
|
|
||||||
int
|
int
|
||||||
internal_function
|
internal_function
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
__aio_notify_only (struct sigevent *sigev, pid_t caller_pid)
|
|
||||||
#else
|
|
||||||
__aio_notify_only (struct sigevent *sigev)
|
__aio_notify_only (struct sigevent *sigev)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
@ -99,15 +95,9 @@ __aio_notify_only (struct sigevent *sigev)
|
|||||||
#if _POSIX_REALTIME_SIGNALS > 0
|
#if _POSIX_REALTIME_SIGNALS > 0
|
||||||
/* Note that the standard gives us the option of using a plain
|
/* Note that the standard gives us the option of using a plain
|
||||||
non-queuing signal here when SA_SIGINFO is not set for the signal. */
|
non-queuing signal here when SA_SIGINFO is not set for the signal. */
|
||||||
# ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
if (__aio_sigqueue (sigev->sigev_signo, sigev->sigev_value, caller_pid)
|
|
||||||
< 0)
|
|
||||||
result = -1;
|
|
||||||
# else
|
|
||||||
if (__aio_sigqueue (sigev->sigev_signo, sigev->sigev_value, getpid ())
|
if (__aio_sigqueue (sigev->sigev_signo, sigev->sigev_value, getpid ())
|
||||||
< 0)
|
< 0)
|
||||||
result = -1;
|
result = -1;
|
||||||
# endif
|
|
||||||
#else
|
#else
|
||||||
/* There are no queued signals on this system at all. */
|
/* There are no queued signals on this system at all. */
|
||||||
result = raise (sigev->sigev_signo);
|
result = raise (sigev->sigev_signo);
|
||||||
@ -125,11 +115,7 @@ __aio_notify (struct requestlist *req)
|
|||||||
struct waitlist *waitlist;
|
struct waitlist *waitlist;
|
||||||
struct aiocb *aiocbp = &req->aiocbp->aiocb;
|
struct aiocb *aiocbp = &req->aiocbp->aiocb;
|
||||||
|
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
if (__aio_notify_only (&aiocbp->aio_sigevent, req->caller_pid) != 0)
|
|
||||||
#else
|
|
||||||
if (__aio_notify_only (&aiocbp->aio_sigevent) != 0)
|
if (__aio_notify_only (&aiocbp->aio_sigevent) != 0)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
/* XXX What shall we do if already an error is set by
|
/* XXX What shall we do if already an error is set by
|
||||||
read/write/fsync? */
|
read/write/fsync? */
|
||||||
@ -162,11 +148,7 @@ __aio_notify (struct requestlist *req)
|
|||||||
this request is the last one, send the signal. */
|
this request is the last one, send the signal. */
|
||||||
if (--*waitlist->counterp == 0)
|
if (--*waitlist->counterp == 0)
|
||||||
{
|
{
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
__aio_notify_only (waitlist->sigevp, waitlist->caller_pid);
|
|
||||||
#else
|
|
||||||
__aio_notify_only (waitlist->sigevp);
|
__aio_notify_only (waitlist->sigevp);
|
||||||
#endif
|
|
||||||
/* This is tricky. See lio_listio.c for the reason why
|
/* This is tricky. See lio_listio.c for the reason why
|
||||||
this works. */
|
this works. */
|
||||||
free ((void *) waitlist->counterp);
|
free ((void *) waitlist->counterp);
|
||||||
|
@ -145,9 +145,6 @@ aio_suspend (const struct aiocb *const list[], int nent,
|
|||||||
waitlist[cnt].next = requestlist[cnt]->waiting;
|
waitlist[cnt].next = requestlist[cnt]->waiting;
|
||||||
waitlist[cnt].counterp = &cntr;
|
waitlist[cnt].counterp = &cntr;
|
||||||
waitlist[cnt].sigevp = NULL;
|
waitlist[cnt].sigevp = NULL;
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
waitlist[cnt].caller_pid = 0; /* Not needed. */
|
|
||||||
#endif
|
|
||||||
requestlist[cnt]->waiting = &waitlist[cnt];
|
requestlist[cnt]->waiting = &waitlist[cnt];
|
||||||
any = true;
|
any = true;
|
||||||
}
|
}
|
||||||
|
@ -107,14 +107,7 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
|
|||||||
pthread_mutex_unlock (&__aio_requests_mutex);
|
pthread_mutex_unlock (&__aio_requests_mutex);
|
||||||
|
|
||||||
if (LIO_MODE (mode) == LIO_NOWAIT)
|
if (LIO_MODE (mode) == LIO_NOWAIT)
|
||||||
{
|
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
__aio_notify_only (sig,
|
|
||||||
sig->sigev_notify == SIGEV_SIGNAL ? getpid () : 0);
|
|
||||||
#else
|
|
||||||
__aio_notify_only (sig);
|
__aio_notify_only (sig);
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -140,9 +133,6 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
|
|||||||
waitlist[cnt].next = requests[cnt]->waiting;
|
waitlist[cnt].next = requests[cnt]->waiting;
|
||||||
waitlist[cnt].counterp = &total;
|
waitlist[cnt].counterp = &total;
|
||||||
waitlist[cnt].sigevp = NULL;
|
waitlist[cnt].sigevp = NULL;
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
waitlist[cnt].caller_pid = 0; /* Not needed. */
|
|
||||||
#endif
|
|
||||||
requests[cnt]->waiting = &waitlist[cnt];
|
requests[cnt]->waiting = &waitlist[cnt];
|
||||||
++total;
|
++total;
|
||||||
}
|
}
|
||||||
@ -190,9 +180,6 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
pid_t caller_pid = sig->sigev_notify == SIGEV_SIGNAL ? getpid () : 0;
|
|
||||||
#endif
|
|
||||||
total = 0;
|
total = 0;
|
||||||
|
|
||||||
for (cnt = 0; cnt < nent; ++cnt)
|
for (cnt = 0; cnt < nent; ++cnt)
|
||||||
@ -209,9 +196,6 @@ lio_listio_internal (int mode, struct aiocb *const list[], int nent,
|
|||||||
waitlist->list[cnt].next = requests[cnt]->waiting;
|
waitlist->list[cnt].next = requests[cnt]->waiting;
|
||||||
waitlist->list[cnt].counterp = &waitlist->counter;
|
waitlist->list[cnt].counterp = &waitlist->counter;
|
||||||
waitlist->list[cnt].sigevp = &waitlist->sigev;
|
waitlist->list[cnt].sigevp = &waitlist->sigev;
|
||||||
#ifdef BROKEN_THREAD_SIGNALS
|
|
||||||
waitlist->list[cnt].caller_pid = caller_pid;
|
|
||||||
#endif
|
|
||||||
requests[cnt]->waiting = &waitlist->list[cnt];
|
requests[cnt]->waiting = &waitlist->list[cnt];
|
||||||
++total;
|
++total;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user