Hey, just looking for someone to let me know if I’m using InterProcessLock Correctly.
Basically, I have a ValueTree that needs to get saved to disk periodically.
Right now my save() function looks something like this
void Profile::save()
{
//SaveLock is declared in the memeber variables as a InterProcessLock
const InterProcessLock::ScopedLockType sl (saveLock);
saveFile.deleteFile();
FileOutputStream os(saveFile);
playerTree.writeToStream(os);
lastModTime = saveFile.getLastModificationTime();
needsToSave = false;
autoSaveCounter = 0;
}
Everything works fine, I’m just not too familiar with multithreading and locks so just want to double check this is correct. Sorry if this posts seems dumb lol
