mirror of https://github.com/containers/podman.git
pkg/parallel: remove deadcode
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
6bfd28bc6f
commit
880808dfb9
|
@ -11,10 +11,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// Maximum number of jobs that will be used.
|
|
||||||
// Set a low, but non-zero, default. We'll be overriding it by default
|
|
||||||
// anyways.
|
|
||||||
numThreads uint = 8
|
|
||||||
// Semaphore to control thread creation and ensure numThreads is
|
// Semaphore to control thread creation and ensure numThreads is
|
||||||
// respected.
|
// respected.
|
||||||
jobControl *semaphore.Weighted
|
jobControl *semaphore.Weighted
|
||||||
|
@ -32,19 +28,12 @@ func SetMaxThreads(threads uint) error {
|
||||||
jobControlLock.Lock()
|
jobControlLock.Lock()
|
||||||
defer jobControlLock.Unlock()
|
defer jobControlLock.Unlock()
|
||||||
|
|
||||||
numThreads = threads
|
|
||||||
jobControl = semaphore.NewWeighted(int64(threads))
|
jobControl = semaphore.NewWeighted(int64(threads))
|
||||||
logrus.Infof("Setting parallel job count to %d", threads)
|
logrus.Infof("Setting parallel job count to %d", threads)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMaxThreads returns the current number of threads that will be used for
|
|
||||||
// parallel jobs.
|
|
||||||
func GetMaxThreads() uint {
|
|
||||||
return numThreads
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enqueue adds a single function to the parallel jobs queue. This function will
|
// Enqueue adds a single function to the parallel jobs queue. This function will
|
||||||
// be run when an unused thread is available.
|
// be run when an unused thread is available.
|
||||||
// Returns a receive-only error channel that will return the error (if any) from
|
// Returns a receive-only error channel that will return the error (if any) from
|
||||||
|
|
Loading…
Reference in New Issue