1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00
2006-08-03  Ulrich Drepper  <drepper@redhat.com>
	* rt/Makefile (tests): Add tst-clock2.
	* rt/tst-clock2.c: New file.

	[BZ #2978]
	* resolv/gai_notify.c (__gai_notify_only): Copy memory for thread
	function and its parameters and pass it to new thread.
	(__gai_notify): Add support for alternative waiting for completion.
	* resolv/gai_suspend.c (gai_suspend): Add support for alternative
	waiting for completion.
	* resolv/getaddrinfo_a.c: Likewise.
	* resolv/gai_misc.h (struct waitlist): Don't add cond if alternative
	waiting for completion is used.
	* resolv/gai_misc.c: Allow overwriting code to start helper thread.
	* resolv/gai_cancel.c: Include <gai_misc.h> not "gai_misc.h".
	* resolv/gai_error.c: Likewise.
	* resolv/gai_sigqueue.c: Likewise.

	* hurd/getdport.c (__detdport): Don't return EBADF; instead set
	errno to EBADF and return MACH_PORT_NULL.
	* posix/Makefile (CFLAGS-waitid.c): Add -fasynchronous-unwind-tables.
This commit is contained in:
Ulrich Drepper
2006-08-03 08:17:20 +00:00
parent 6eab4ee54b
commit f1762c0c4b
15 changed files with 397 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2001 Free Software Foundation, Inc.
/* Copyright (C) 2001, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <unistd.h>
#include "gai_misc.h"
#include <gai_misc.h>
/* We need this special structure to handle asynchronous I/O. */
@@ -96,7 +96,9 @@ getaddrinfo_a (int mode, struct gaicb *list[], int ent, struct sigevent *sig)
}
else if (mode == GAI_WAIT)
{
#ifndef DONT_NEED_GAI_MISC_COND
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
#endif
struct waitlist waitlist[ent];
int oldstate;
@@ -104,7 +106,9 @@ getaddrinfo_a (int mode, struct gaicb *list[], int ent, struct sigevent *sig)
for (cnt = 0; cnt < ent; ++cnt)
if (requests[cnt] != NULL)
{
#ifndef DONT_NEED_GAI_MISC_COND
waitlist[cnt].cond = &cond;
#endif
waitlist[cnt].next = requests[cnt]->waiting;
waitlist[cnt].counterp = &total;
waitlist[cnt].sigevp = NULL;
@@ -119,15 +123,24 @@ getaddrinfo_a (int mode, struct gaicb *list[], int ent, struct sigevent *sig)
pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate);
while (total > 0)
pthread_cond_wait (&cond, &__gai_requests_mutex);
{
#ifdef DONT_NEED_GAI_MISC_COND
int result;
GAI_MISC_WAIT (result, total, NULL, 1);
#else
pthread_cond_wait (&cond, &__gai_requests_mutex);
#endif
}
/* Now it's time to restore the cancelation state. */
pthread_setcancelstate (oldstate, NULL);
#ifndef DONT_NEED_GAI_MISC_COND
/* Release the conditional variable. */
if (pthread_cond_destroy (&cond) != 0)
/* This must never happen. */
abort ();
#endif
}
else
{
@@ -147,7 +160,9 @@ getaddrinfo_a (int mode, struct gaicb *list[], int ent, struct sigevent *sig)
for (cnt = 0; cnt < ent; ++cnt)
if (requests[cnt] != NULL)
{
#ifndef DONT_NEED_GAI_MISC_COND
waitlist->list[cnt].cond = NULL;
#endif
waitlist->list[cnt].next = requests[cnt]->waiting;
waitlist->list[cnt].counterp = &waitlist->counter;
waitlist->list[cnt].sigevp = &waitlist->sigev;