implemented all synchronization methods
BUT there's something that produce a deadlock