Counting Semaphores

Dear All,    Can anybody tell me the use of Counting Semaphores with proper examples ?, please.

Counting Semaphores

http://www.freertos.org/CreateCounting.html gives scenarios where they are used. Maybe there is something in to book too.