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,331
  • 1
  • 23
  • 34

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,483
  • 15
  • 80
  • 92
Johnny
  • 8,045
  • 2
  • 24
  • 33