Toward implementing the counter approach to monitor threads