@@ -36,30 +36,30 @@ class CScanFile
36
36
void LockFreeThreadProc ();
37
37
38
38
protected:
39
- HANDLE _hFile = nullptr ;
39
+ HANDLE _hFile = nullptr ;
40
40
41
41
// For memory mapping:
42
- HANDLE _hFileMapping = nullptr ;
43
- void * _pViewOfFile = nullptr ;
42
+ HANDLE _hFileMapping = nullptr ;
43
+ void * _pViewOfFile = nullptr ;
44
44
45
45
// For async IO:
46
- HANDLE _hAsyncEvent = nullptr ;
47
- LARGE_INTEGER _asyncFileOffset = {};
48
- OVERLAPPED _asyncOverlapped = {};
49
- bool _asyncOperationInProgress = false ;
46
+ HANDLE _hAsyncEvent = nullptr ;
47
+ LARGE_INTEGER _asyncFileOffset = {};
48
+ OVERLAPPED _asyncOverlapped = {};
49
+ bool _asyncOperationInProgress = false ;
50
50
51
51
// Separate thread + Lock free:
52
- HANDLE _hThread = nullptr ;
53
- bool _threadOperationInProgress = false ; // for protection against wrong API usage, not for use in a worker thread, no memory protection
52
+ HANDLE _hThread = nullptr ;
53
+ bool _threadOperationInProgress = false ; // for protection against wrong API usage, not for use in a worker thread, no memory protection
54
54
// Spin lock variables:
55
55
// We could use kernel-mode events instead of spin locks, it will save CPU, but will loose time during synchronization (switch to kernel).
56
56
alignas (std::hardware_constructive_interference_size) // small speedup to get a bunch of variables into single cache line
57
- bool _threadFinishSpinlock = false ;
58
- bool _threadOperationReadStartSpinlock = false ;
59
- bool _threadOperationReadCompletedSpinlock = false ;
57
+ bool _threadFinishSpinlock = false ;
58
+ bool _threadOperationReadStartSpinlock = false ;
59
+ bool _threadOperationReadCompletedSpinlock = false ;
60
60
// other data protected by spin locks:
61
- char * _pThreadReadBuffer = nullptr ;
62
- size_t _threadReadBufferSize = 0 ;
63
- size_t _threadActuallyReadBytes = 0 ;
64
- bool _threadReadSucceeded = false ;
61
+ char * _pThreadReadBuffer = nullptr ;
62
+ size_t _threadReadBufferSize = 0 ;
63
+ size_t _threadActuallyReadBytes = 0 ;
64
+ bool _threadReadSucceeded = false ;
65
65
};
0 commit comments