<p><ahref="classtf_1_1CriticalSection.html" class="m-doc">tf::<wbr/>CriticalSection</a> is a warpper over <ahref="classtf_1_1Semaphore.html" class="m-doc">tf::<wbr/>Semaphore</a> and is specialized for limiting the maximum concurrency over a set of tasks. A critical section starts with an initial count representing that limit. When a task is added to the critical section, the task acquires and releases the semaphore internal to the critical section. This design avoids explicit call of <ahref="classtf_1_1Task.html#a076ab9c6f3a0346e16cfb5fee7dc4ce8" class="m-doc">tf::<wbr/>Task::<wbr/>acquire</a> and <ahref="classtf_1_1Task.html#a26709523eb112f2d024f4c0e9d2f0019" class="m-doc">tf::<wbr/>Task::<wbr/>release</a>. The following example creates a critical section of one worker and adds the five tasks to the critical section.</p><preclass="m-code"><spanclass="n">tf</span><spanclass="o">::</span><spanclass="n">Executor</span><spanclass="n">executor</span><spanclass="p">(</span><spanclass="mi">8</span><spanclass="p">);</span><spanclass="c1">// create an executor of 8 workers</span>