@@ -94,7 +94,7 @@ MethodContextReader::MethodContextReader(
94
94
, Offset(offset)
95
95
, Increment(increment)
96
96
{
97
- this ->mutex = CreateMutexW ( NULL , FALSE , nullptr );
97
+ minipal_mutex_init (& this ->mutex );
98
98
99
99
std::string tocFileName, mchFileName;
100
100
@@ -140,20 +140,19 @@ MethodContextReader::~MethodContextReader()
140
140
CloseHandle (this ->fileHandle );
141
141
}
142
142
143
- CloseHandle (this ->mutex );
144
-
143
+ minipal_mutex_destroy (&this ->mutex );
145
144
CleanExcludedMethods ();
146
145
}
147
146
148
147
bool MethodContextReader::AcquireLock ()
149
148
{
150
- DWORD res = WaitForSingleObject ( this ->mutex , INFINITE );
151
- return (res == WAIT_OBJECT_0) ;
149
+ minipal_mutex_enter (& this ->mutex );
150
+ return true ;
152
151
}
153
152
154
153
void MethodContextReader::ReleaseLock ()
155
154
{
156
- ReleaseMutex ( this ->mutex );
155
+ minipal_mutex_leave (& this ->mutex );
157
156
}
158
157
159
158
bool MethodContextReader::atEof ()
@@ -418,7 +417,7 @@ bool MethodContextReader::hasTOC()
418
417
419
418
bool MethodContextReader::isValid ()
420
419
{
421
- return this ->fileHandle != INVALID_HANDLE_VALUE && this -> mutex != INVALID_HANDLE_VALUE ;
420
+ return this ->fileHandle != INVALID_HANDLE_VALUE;
422
421
}
423
422
424
423
// Return a measure of "progress" through the method contexts, as follows:
@@ -640,7 +639,7 @@ void MethodContextReader::Reset(const int* newIndexes, int newIndexCount)
640
639
int64_t pos = 0 ;
641
640
BOOL result = SetFilePointerEx (fileHandle, *(PLARGE_INTEGER)&pos, NULL , FILE_BEGIN);
642
641
assert (result);
643
-
642
+
644
643
Indexes = newIndexes;
645
644
IndexCount = newIndexCount;
646
645
curIndexPos = 0 ;
0 commit comments