add threaded_counter_based_example.cpp