This is required because these classes are copied in both the main and the worker threads and using plain int is MT-unsafe.