SetNumWorkers sets the number of workers to create which solve blocks. Any negative values will cause a default number of workers to be used which is based on the number of processor cores in the system. A value of 0 will cause all CPU mining to be stopped.
This function is safe for concurrent access.
// It's safe to call start even if it's already started. s.server.cpuMiner.SetNumWorkers(int32(genProcLimit)) s.server.cpuMiner.Start() }