user2217057
user2217057

Reputation: 237

Locking function parameter with ReaderWriterLockSlim to resolve index out of range problem

The simplified code below is for illustration. Class1 creates a dynamic static object dynamObj based on JSON stream from the back end. A locker is used when updating dynamObj. Then Class2 takes that dynamObj for further processing, but sometimes (not always) an index out-of-range exception is triggered when looping through the array-based properties of dynamObj. Here is the question:

Upvotes: 0

Views: 32

Answers (0)

Related Questions