Spinner

constructor()

Creates an instance of the Spinner class.


constructor(threadCount: Int)

Creates an instance of the Spinner class.

Parameters

threadCount

Denotes the number of threads in a group that may wait for a common condition in the spin-loop. This information is used to check if the number of available CPUs is greater than the number of threads and avoid spinning if that is not the case.


constructor(threadCounter: () -> Int)

Creates an instance of the Spinner class.

Parameters

threadCounter

Denotes the number of threads in a group that may wait for a common condition in the spin-loop. The number of threads in a group is allowed to change dynamically --- the spinner queries this number on each spin iteration, avoiding the spinning if necessary. This information is used to check if the number of available CPUs is greater than the number of threads in the group and avoid spinning if that is not the case.