@@ -361,7 +361,7 @@ std::optional<std::string_view> CMappingLineReader::GetNextLine()
361361// ////////////////////////////////////////////////////////////////////////
362362// ////////////////////////////////////////////////////////////////////////
363363
364- CLockFreeLineReader::CLockFreeLineReader ()
364+ CSpinlockLineReader::CSpinlockLineReader ()
365365{
366366 this ->_buffer1 .Allocate (ReadBufferSize);
367367 if (this ->_buffer1 .ptr != nullptr )
@@ -370,7 +370,7 @@ CLockFreeLineReader::CLockFreeLineReader()
370370 }
371371}
372372
373- bool CLockFreeLineReader ::Open (const wchar_t * const filename)
373+ bool CSpinlockLineReader ::Open (const wchar_t * const filename)
374374{
375375 if (this ->_buffer1 .ptr == nullptr || filename == nullptr )
376376 {
@@ -389,32 +389,32 @@ bool CLockFreeLineReader::Open(const wchar_t* const filename)
389389 this ->_bufferData = std::string_view (this ->_buffer1 .ptr , 0 );
390390 this ->_firstBufferIsActive = true ;
391391
392- const bool initLockFreeOk = this ->_file .LockFreecInit ();
393- if (!initLockFreeOk )
392+ const bool initSpinlockOk = this ->_file .SpinlockInit ();
393+ if (!initSpinlockOk )
394394 {
395395 this ->_file .Close ();
396396 return false ;
397397 }
398398
399- const bool readStartOk = this ->_file .LockFreeReadStart (this ->_buffer2 .ptr + ReadBufferOffset, ReadChunkSize);
399+ const bool readStartOk = this ->_file .SpinlockReadStart (this ->_buffer2 .ptr + ReadBufferOffset, ReadChunkSize);
400400 if (!readStartOk)
401401 {
402- this ->_file .LockFreecClean ();
402+ this ->_file .SpinlockClean ();
403403 this ->_file .Close ();
404404 return false ;
405405 }
406406
407407 return true ;
408408}
409409
410- void CLockFreeLineReader ::Close ()
410+ void CSpinlockLineReader ::Close ()
411411{
412- this ->_file .LockFreecClean ();
412+ this ->_file .SpinlockClean ();
413413 this ->_file .Close ();
414414}
415415
416416__declspec (noinline) // noinline is added to help CPU profiling in release version
417- std::optional<std::string_view> CLockFreeLineReader ::GetNextLine()
417+ std::optional<std::string_view> CSpinlockLineReader ::GetNextLine()
418418{
419419 if (this ->_buffer1 .ptr == nullptr )
420420 {
@@ -446,15 +446,15 @@ std::optional<std::string_view> CLockFreeLineReader::GetNextLine()
446446 memcpy (newDataBufferPtr, this ->_bufferData .data (), prefixLength);
447447
448448 size_t readBytes = 0 ;
449- const bool readCompleteOk = this ->_file .LockFreeReadWait (readBytes);
449+ const bool readCompleteOk = this ->_file .SpinlockReadWait (readBytes);
450450 if (!readCompleteOk)
451451 {
452452 // Previous reading failed
453453 return {};
454454 }
455455
456456 // Read missing data:
457- const bool readOk = this ->_file .LockFreeReadStart (currentBuffer.ptr + ReadBufferOffset, ReadChunkSize);
457+ const bool readOk = this ->_file .SpinlockReadStart (currentBuffer.ptr + ReadBufferOffset, ReadChunkSize);
458458 if (!readOk)
459459 {
460460 // New reading failed
0 commit comments