Skip to content

Commit

Permalink
Make access to the state thread safe.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfowl committed Jul 21, 2012
1 parent 50ee2b9 commit 8464514
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions SignalR.Client/Hubs/HubProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ public JToken this[string name]
{
get
{
JToken value;
_state.TryGetValue(name, out value);
return value;
lock (_state)
{
JToken value;
_state.TryGetValue(name, out value);
return value;
}
}
set
{
_state[name] = value;
lock (_state)
{
_state[name] = value;
}
}
}

Expand Down

0 comments on commit 8464514

Please sign in to comment.