File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -2215,28 +2215,23 @@ void TimelineEventFileRecorderBase::ShutDown() {
22152215
22162216TimelineEventBlock* TimelineEventFileRecorderBase::GetNewBlockLocked () {
22172217  ASSERT (lock_.IsOwnedByCurrentThread ());
2218-   //  Start by reusing a block.
22192218  TimelineEventBlock* block = nullptr ;
2220-   if  (empty_blocks_ != nullptr ) {
2221-     //  TODO(vegorov) maybe we don't want to take a lock just to grab an empty
2222-     //  block?
2219+   {
22232220    MonitorLocker ml (&monitor_);
22242221    if  (empty_blocks_ != nullptr ) {
22252222      block = empty_blocks_;
22262223      empty_blocks_ = empty_blocks_->next ();
2227-       if  (FLAG_trace_timeline) {
2228-         OS::PrintErr (" Reused empty block %p\n "  , block);
2229-       }
22302224    }
22312225  }
22322226  if  (block == nullptr ) {
22332227    block = new  TimelineEventBlock (block_count_++);
22342228    if  (FLAG_trace_timeline) {
22352229      OS::PrintErr (" Created new block %p\n "  , block);
22362230    }
2231+   } else  if  (FLAG_trace_timeline) {
2232+     OS::PrintErr (" Reused empty block %p\n "  , block);
22372233  }
22382234  block->Open ();
2239- 
22402235  return  block;
22412236}
22422237
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments