0

I came across the following code in c#:

        semaphore.Wait();
        {
            HandleRateLimit(region);
        }
        semaphore.Release();

(source)

I was wondering, do the brackets around the HandleRateLimit(...) call have any special meaning? If not, why would someone write code that way?

Mingwei Samuel
  • 2,917
  • 1
  • 30
  • 40

1 Answers1

1

Brackets have nothing to do with semaphores. The idea was, probably, to make it more readable and to point out critical section.

Rob
  • 26,989
  • 16
  • 82
  • 98
Johnny
  • 8,939
  • 2
  • 28
  • 33