Thread-safe counting of triples
Merge branch 'thread-safe-count'