Standart realisation of Readers Writers Logic, using semaphores (C++)