Lines 98-109
internal_function
Link Here
|
98 |
__gai_notify (struct requestlist *req) |
98 |
__gai_notify (struct requestlist *req) |
99 |
{ |
99 |
{ |
100 |
struct waitlist *waitlist; |
100 |
struct waitlist *waitlist; |
|
|
101 |
struct waitlist *lastp; |
101 |
|
102 |
|
102 |
/* Now also notify possibly waiting threads. */ |
103 |
/* Now also notify possibly waiting threads. */ |
|
|
104 |
lastp = NULL; |
103 |
waitlist = req->waiting; |
105 |
waitlist = req->waiting; |
104 |
while (waitlist != NULL) |
106 |
while (waitlist != NULL) |
105 |
{ |
107 |
{ |
106 |
struct waitlist *next = waitlist->next; |
108 |
struct waitlist *next = waitlist->next; |
|
|
109 |
int removed = 0; |
107 |
|
110 |
|
108 |
if (waitlist->sigevp == NULL) |
111 |
if (waitlist->sigevp == NULL) |
109 |
{ |
112 |
{ |
Lines 122-132
__gai_notify (struct requestlist *req)
Link Here
|
122 |
if (--*waitlist->counterp == 0) |
125 |
if (--*waitlist->counterp == 0) |
123 |
{ |
126 |
{ |
124 |
__gai_notify_only (waitlist->sigevp, waitlist->caller_pid); |
127 |
__gai_notify_only (waitlist->sigevp, waitlist->caller_pid); |
|
|
128 |
|
129 |
/* Remove from the request's waitlist */ |
130 |
if (lastp != NULL) |
131 |
lastp->next = next; |
132 |
else |
133 |
req->waiting = next; |
134 |
removed = 1; |
135 |
|
125 |
/* This is tricky. See getaddrinfo_a.c for the reason why |
136 |
/* This is tricky. See getaddrinfo_a.c for the reason why |
126 |
this works. */ |
137 |
this works. */ |
127 |
free ((void *) waitlist->counterp); |
138 |
free ((void *) waitlist->counterp); |
128 |
} |
139 |
} |
129 |
|
140 |
|
|
|
141 |
if (!removed) |
142 |
lastp = waitlist; |
130 |
waitlist = next; |
143 |
waitlist = next; |
131 |
} |
144 |
} |
132 |
} |
145 |
} |