implemented SelectorContext based on count-latch primitives