[jdk17u-dev] RFR: 8312065: Socket.connect does not timeout when profiling [v4]
Long Yang
duke at openjdk.org
Fri Sep 8 06:27:51 UTC 2023
On Thu, 7 Sep 2023 16:43:00 GMT, Vyom Tewari <vtewari at openjdk.org> wrote:
>> Long Yang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> push to trigger github workflows
>
> src/java.base/aix/native/libnet/aix_close.c line 502:
>
>> 500: ret = poll(ufds, nfds, timeout);
>> 501: endOp(fdEntry, &self);
>> 502: return ret;
>
> with this approach we have lot of duplicate code what if we reuse most of the duplicate code as follows ?
>
> #define BLOCKING_IO_RETURN_INT(FD, FUNC) { \
> int ret; \
> do { \
> ret = NONBLOCKING_IO_RETURN_INT(FD, FUNC); \
> } while (ret == -1 && errno == EINTR); \
> return ret; \
> }
>
> #define NONBLOCKING_IO_RETURN_INT(FD, FUNC) { \
> int ret; \
> threadEntry_t self; \
> fdEntry_t *fdEntry = getFdEntry(FD); \
> if (fdEntry == NULL) { \
> errno = EBADF; \
> return -1; \
> } \
> startOp(fdEntry, &self); \
> ret = FUNC; \
> endOp(fdEntry, &self); \
> return ret; \
> }
hi, vyommani, thanks for the suggestion. Do you mind if I modify it like Paul did, I feel like this would make the macro cleaner.
-------------
PR Review Comment: https://git.openjdk.org/jdk17u-dev/pull/1639#discussion_r1319417250
More information about the jdk-updates-dev
mailing list