Skip to content
This repository
Browse code

Make access to the state thread safe.

  • Loading branch information...
commit 8464514a8dab4a02d6134f4d94caf390d6fcb846 1 parent 50ee2b9
David Fowler authored July 21, 2012

Showing 1 changed file with 10 additions and 4 deletions. Show diff stats Hide diff stats

  1. 14  SignalR.Client/Hubs/HubProxy.cs
14  SignalR.Client/Hubs/HubProxy.cs
@@ -30,13 +30,19 @@ public HubProxy(IConnection connection, string hubName)
30 30
         {
31 31
             get
32 32
             {
33  
-                JToken value;
34  
-                _state.TryGetValue(name, out value);
35  
-                return value;
  33
+                lock (_state)
  34
+                {
  35
+                    JToken value;
  36
+                    _state.TryGetValue(name, out value);
  37
+                    return value;
  38
+                }
36 39
             }
37 40
             set
38 41
             {
39  
-                _state[name] = value;
  42
+                lock (_state)
  43
+                {
  44
+                    _state[name] = value;
  45
+                }
40 46
             }
41 47
         }
42 48
 

0 notes on commit 8464514

Please sign in to comment.
Something went wrong with that request. Please try again.