title: Lock analog in Azure
body: <p>I need to implement some thread consequent logic in Azure web instances. 
  I have some code like this:        </p>
  
  <pre><code>lock (_bookingLock)
  {
      // Check for a free time
      bool isTimeFree = _scheduleService.IsTimeFree(dateTimeGuidId);
      //* race condition here
      if (isTimeFree)
      {
          // Make a booking. So this time is busy
          newBookingId = _paymentService.CreateBooking(dateTimeGuidId).ToString();
      }
  }
  </code></pre>
  
  <p>But I can't use <strong><code>lock</code></strong> in a multi instance environment and I can't omit lock because there is a  race condition at <code>*</code>. What is the best approach here?</p>