Code52 / DownmarkerWPF

MarkPad - a visual Markdown editor (inspired by the Downmarker project)
http://code52.org/DownmarkerWPF/
Microsoft Public License
1.4k stars 459 forks source link

only one thread can use the settings file at once #436

Closed kkostov closed 9 years ago

kkostov commented 9 years ago

435 - FileSystemStorageSettingsStore can only have a single thread

reading and/or writing to the settings file.

When multiple files are selected for opening in an Open file dialog, JumpListIntegration would try to update the recent files in settings separately for each filename (by handling FileOpenEvent). This seems to create a race where it's possible to have the settings file still locked while attempting to update it again.

I've added a SemaphoreSlim that would ensure that there is only a single thread being able to read or write to the settings file at a time.

shiftkey commented 9 years ago

Thanks!