chopstx_poll: More change.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
10
chopstx.c
10
chopstx.c
@@ -1393,11 +1393,7 @@ chx_proxy_init (struct chx_px *px, uint32_t *cp)
|
|||||||
* should be one of:
|
* should be one of:
|
||||||
* chopstx_poll_cond_t, chopstx_poll_join_t, or chopstx_intr_t.
|
* chopstx_poll_cond_t, chopstx_poll_join_t, or chopstx_intr_t.
|
||||||
*
|
*
|
||||||
* Returns number of active descriptors. Don't assume no active
|
* Returns number of active descriptors.
|
||||||
* descriptors means timeout. It is possible for chopstx_poll to
|
|
||||||
* return zero (but not because of timeout), when it's woken up but
|
|
||||||
* found no condition matches. Application should call chopstx_poll
|
|
||||||
* again in this situation.
|
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
chopstx_poll (uint32_t *usec_p, int n, struct chx_poll_head *const pd_array[])
|
chopstx_poll (uint32_t *usec_p, int n, struct chx_poll_head *const pd_array[])
|
||||||
@@ -1415,6 +1411,7 @@ chopstx_poll (uint32_t *usec_p, int n, struct chx_poll_head *const pd_array[])
|
|||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
chx_proxy_init (&px[i], &counter);
|
chx_proxy_init (&px[i], &counter);
|
||||||
|
|
||||||
|
again:
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
pd = pd_array[i];
|
pd = pd_array[i];
|
||||||
@@ -1522,6 +1519,9 @@ chopstx_poll (uint32_t *usec_p, int n, struct chx_poll_head *const pd_array[])
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
chopstx_exit (CHOPSTX_CANCELED);
|
chopstx_exit (CHOPSTX_CANCELED);
|
||||||
|
|
||||||
|
if (counter == 0 && (usec_p == NULL || *usec_p))
|
||||||
|
goto again;
|
||||||
|
|
||||||
return counter;
|
return counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user