RFR: 8229517: Support for optional asynchronous/buffered logging [v17]
Albert Mingkun Yang
ayang at openjdk.java.net
Fri May 21 10:09:39 UTC 2021
On Thu, 20 May 2021 09:08:04 GMT, Xin Liu <xliu at openjdk.org> wrote:
>> This patch provides a buffer to store asynchrounous messages and flush them to
>> underlying files periodically.
>
> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
>
> Update according to reviewer's feedback.
src/hotspot/share/logging/logAsyncWriter.cpp line 155:
> 153: }
> 154:
> 155: assert(_state == ThreadState::Terminated, "sanity check");
I can't seem to find where `_state` is set to `ThreadState::Terminated` in this PR.
src/hotspot/share/logging/logAsyncWriter.cpp line 167:
> 165: AsyncLogWriter* self = new AsyncLogWriter();
> 166:
> 167: if (self->_state == ThreadState::Initialized) {
The content of this `if` could be inlined to the constructor, and `ThreadState::Initialized` could be removed then, right?
src/hotspot/share/logging/logFileOutput.cpp line 312:
> 310: if (aio_writer != nullptr) {
> 311: aio_writer->enqueue(*this, decorations, msg);
> 312: return -1;
Any difference between returning 0 and -1 here? Could you add some comments if any?
-------------
PR: https://git.openjdk.java.net/jdk/pull/3135
More information about the hotspot-dev
mailing list