Re: [PATCH v4 2/9] add "this" pointers to more target APIs

Tom Tromey
2013-12-06T18:23:30Z

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Tom> I'll remove "is_async". Unless you'd rather I remove "can_async".

Pedro> No, that's fine. "is_async" would be my choice as well.

I looked deeper than the two are still subtly different.
Specifically, remote.c delegates to serial:

return serial_can_async_p (rs->remote_desc);
return serial_is_async_p (rs->remote_desc);

And these really do differ:

int
serial_can_async_p (struct serial *scb)
{
return (scb->ops->async != NULL);
}

int
serial_is_async_p (struct serial *scb)
{
return (scb->ops->async != NULL) && (scb->async_handler != NULL);
}

I find it a bit odd that the upper layers rely on the serial layer to do
this bookkeeping.

Tom