You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (_curr_buf->status == cell_buffer::FREE) {
_curr_buf->status = cell_buffer::FULL; // set to FULL
cell_buffer* next_buf = _curr_buf->next;
// tell backend thread 通知消费者线程把cell中的log更新到文件。
tell_back = true;
// it suggest that this buffer is under the persist job
if (next_buf->status == cell_buffer::FULL) {
// if mem use < MEM_USE_LIMIT, allocate new cell_buffer
if (_one_buff_len * (_buff_cnt + 1) > MEM_USE_LIMIT) {
fprintf(stderr, "no more log space can use\n");
_curr_buf = next_buf;
_lst_lts = curr_sec;
} else {
cell_buffer* new_buffer = new cell_buffer(_one_buff_len);
_buff_cnt += 1;
new_buffer->prev = _curr_buf;
_curr_buf->next = new_buffer;
new_buffer->next = next_buf;
next_buf->prev = new_buffer;
_curr_buf = new_buffer;
}
} else {
// next buffer is free, we can use it
_curr_buf = next_buf;
}
if (!_lst_lts) _curr_buf->append(log_line, len);
} else //_curr_buf->status == cell_buffer::FULL, assert persist is on here
// too!
{
_lst_lts = curr_sec;
}
if (_curr_buf->status == cell_buffer::FREE) {
_curr_buf->status = cell_buffer::FULL; // set to FULL
cell_buffer* next_buf = _curr_buf->next;
// tell backend thread 通知消费者线程把cell中的log更新到文件。
tell_back = true;
当cell buffer满了的时候,不是应该寻找下一个空的cell buffer吗,为什么这个是没有处理的?
The text was updated successfully, but these errors were encountered: