Skip to content

Commit 19ad5c9

Browse files
committed
Small update.
1 parent b8a8e93 commit 19ad5c9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Common/Commands.Common.Authentication/Authentication/ProtectedFileTokenCache.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,14 @@ public ProtectedFileTokenCache(string cacheFile, IDataStore store = null)
7373

7474
private void Initialize(string fileName)
7575
{
76-
ReadFileIntoCache(fileName);
77-
HasStateChanged = true;
76+
lock(fileLock)
77+
{
78+
ReadFileIntoCache(fileName);
79+
HasStateChanged = true;
7880

79-
// Eagerly create cache file.
80-
WriteCacheIntoFile(fileName);
81+
// Eagerly create cache file.
82+
WriteCacheIntoFile(fileName);
83+
}
8184

8285
AfterAccess = AfterAccessNotification;
8386
BeforeAccess = BeforeAccessNotification;

0 commit comments

Comments
 (0)