Create a new instance, set the maximum number of running threads (default: 1).
Determines the number of running threads.
Remove any reference to threads, but do not reschedule any pending ones.
Stop current thread if already too many are running, otherwise continue.
Unblock the semaphore, reschedule next pending thread.