When selecting tasks, use task value as identifier

Cleaner, thread-safe.