Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

static dictonaries / thisLock - thread safe? #15

Open
dhoelzl opened this issue Nov 16, 2017 · 0 comments
Open

static dictonaries / thisLock - thread safe? #15

dhoelzl opened this issue Nov 16, 2017 · 0 comments

Comments

@dhoelzl
Copy link

dhoelzl commented Nov 16, 2017

Are the following dictionaries

static Dictionary<int, AppServiceConnection> connections = new Dictionary<int, AppServiceConnection>();
static Dictionary<int, AppServiceConnection> desktopBridgeConnections = new Dictionary<int, AppServiceConnection>();
static Dictionary<int, BackgroundTaskDeferral> appServiceDeferrals = new Dictionary<int, BackgroundTaskDeferral>();
static Dictionary<int, BackgroundTaskDeferral> desktopBridgeAppServiceDeferrals = new Dictionary<int, BackgroundTaskDeferral>();

thread safe?

They are accessed all over the code on different threads (according to my debugging experience) (OnBackgroundActivated, OnAppServiceRequestReceived, OnAppServicesCanceled, OndesktopBridgeAppServiceRequestReceived, OndesktopBridgeAppServicesCanceled), but there is only a critical section with thisLock in OnBackgroundActivated.

Do I miss something?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant