title: StackExchange.Redis - LockTake / LockRelease Usage
body: <p>I am using Redis with StackExchange.Redis. I have multiple threads that will at some point access and edit the value of the same key, so I need to synchronize the manipulation of the data. </p>
  
  <p>Looking at the available functions, I see that there are two functions, TakeLock and ReleaseLock. However, these functions take both a key and a value parameter rather than the expected single key to be locked. The intellisene documentation and source on GitHub don't explain how to use the LockTake and LockRelease functions or what to pass in for the key and value parameters. </p>
  
  <p><strong>Q: What is the correct usage of LockTake and LockRelease in StackExchange.Redis?</strong></p>
  
  <p>Pseudocode example of what I'm aiming to do:</p>
  
  <pre><code>//Add Items Before Parallel Execution
  redis.StringSet("myJSONKey", myJSON);
  
  //Parallel Execution
  Parallel.For(0, 100, i =&gt;
      {
          //Some work here
          //....
  
          //Lock
          redis.LockTake("myJSONKey");
  
          //Manipulate
          var myJSONObject = redis.StringGet("myJSONKey");
          myJSONObject.Total++;
          Console.WriteLine(myJSONObject.Total);
          redis.StringSet("myJSONKey", myNewJSON);
  
          //Unlock
          redis.LockRelease("myJSONKey");
  
          //More work here
          //...
      });
  </code></pre>