// SetThreads updates the number of mining threads currently enabled. Calling
// this method does not start mining, only sets the thread count. If zero is
// specified, the miner will use all cores of the machine. Setting a thread
// count below zero is allowed and will cause the miner to idle, without any
// work being done.
SetThreads updates the number of mining threads currently enabled. Calling
this method does not start mining, only sets the thread count. If zero is
specified, the miner will use all cores of the machine. Setting a thread
count below zero is allowed and will cause the miner to idle, without any
work being done.
// SetThreads updates the number of mining threads currently enabled . Calling // this method does not start mining only sets the thread count . If zero is // specified the miner will use all cores of the machine . Setting a thread // count below zero is allowed and will cause the miner to idle without any // work being done .
func (amhash *Amhash) SetThreads(threads int) {
	amhash.lock.Lock()
	defer amhash.lock.Unlock()
	if amhash.shared != nil {
		amhash.shared.SetThreads(threads)
		return
	}
	amhash.threads = threads
	select {
	case amhash.update <- struct{}{}:
	default:
	}
}
func ( amhash * Amhash ) SetThreads ( threads int ) { amhash . lock . Lock ( ) defer amhash . lock . Unlock ( ) if amhash . shared != nil { amhash . shared . SetThreads ( threads ) return } amhash . threads = threads select { case amhash . update <- struct { } { } : default : } }
SetThreads updates the number of mining threads currently enabled.
SetThreads updates the number of mining threads currently enabled .
// If we're running a shared PoW, set the thread count on that instead // Update the threads and ping any running seal to pull in any changes