MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / unlock

Method unlock

libraries/LocalPeer/src/LockedFile_win.cpp:171–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171bool LockedFile::unlock()
172{
173 if (!isOpen()) {
174 qWarning("QtLockedFile::unlock(): file is not opened");
175 return false;
176 }
177
178 if (!isLocked())
179 return true;
180
181 if (m_lock_mode == ReadLock) {
182 ReleaseMutex(rmutex);
183 CloseHandle(rmutex);
184 rmutex = 0;
185 }
186 else {
187 foreach(Qt::HANDLE mutex, rmutexes) {
188 ReleaseMutex(mutex);
189 CloseHandle(mutex);
190 }
191 rmutexes.clear();
192 ReleaseMutex(wmutex);
193 }
194
195 m_lock_mode = LockedFile::NoLock;
196 return true;
197}
198
199LockedFile::~LockedFile()
200{

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected