add mutex to protect thread unsafe map operation
add zero init for counters array, add swaps buffer <-> data