RFR: 8229517: Support for optional asynchronous/buffered logging [v17]
    Xin Liu 
    xliu at openjdk.java.net
       
    Fri May 21 17:21:09 UTC 2021
    
    
  
On Fri, 21 May 2021 09:54:02 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> 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 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?
but it's not exceptional safe. I know hotspot doesn't use c++ exception, but the general principle still applys. 
the more logics in ctor, the more likely to fail.  So far, if something wrong, I left self in state of `NotReady`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3135
    
    
More information about the hotspot-dev
mailing list