using CriticalSection component.