… | |
… | |
586 | etp_maybe_start_thread (pool); |
586 | etp_maybe_start_thread (pool); |
587 | } |
587 | } |
588 | } |
588 | } |
589 | |
589 | |
590 | ETP_API_DECL void ecb_cold |
590 | ETP_API_DECL void ecb_cold |
591 | etp_set_max_poll_time (etp_pool pool, double nseconds) |
591 | etp_set_max_poll_time (etp_pool pool, double seconds) |
592 | { |
592 | { |
593 | if (WORDACCESS_UNSAFE) X_LOCK (pool->reslock); |
593 | if (WORDACCESS_UNSAFE) X_LOCK (pool->reslock); |
594 | pool->max_poll_time = nseconds * ETP_TICKS; |
594 | pool->max_poll_time = seconds * ETP_TICKS; |
595 | if (WORDACCESS_UNSAFE) X_UNLOCK (pool->reslock); |
595 | if (WORDACCESS_UNSAFE) X_UNLOCK (pool->reslock); |
596 | } |
596 | } |
597 | |
597 | |
598 | ETP_API_DECL void ecb_cold |
598 | ETP_API_DECL void ecb_cold |
599 | etp_set_max_poll_reqs (etp_pool pool, unsigned int maxreqs) |
599 | etp_set_max_poll_reqs (etp_pool pool, unsigned int maxreqs) |
… | |
… | |
602 | pool->max_poll_reqs = maxreqs; |
602 | pool->max_poll_reqs = maxreqs; |
603 | if (WORDACCESS_UNSAFE) X_UNLOCK (pool->reslock); |
603 | if (WORDACCESS_UNSAFE) X_UNLOCK (pool->reslock); |
604 | } |
604 | } |
605 | |
605 | |
606 | ETP_API_DECL void ecb_cold |
606 | ETP_API_DECL void ecb_cold |
607 | etp_set_max_idle (etp_pool pool, unsigned int nthreads) |
607 | etp_set_max_idle (etp_pool pool, unsigned int threads) |
608 | { |
608 | { |
609 | if (WORDACCESS_UNSAFE) X_LOCK (pool->reqlock); |
609 | if (WORDACCESS_UNSAFE) X_LOCK (pool->reqlock); |
610 | pool->max_idle = nthreads; |
610 | pool->max_idle = threads; |
611 | if (WORDACCESS_UNSAFE) X_UNLOCK (pool->reqlock); |
611 | if (WORDACCESS_UNSAFE) X_UNLOCK (pool->reqlock); |
612 | } |
612 | } |
613 | |
613 | |
614 | ETP_API_DECL void ecb_cold |
614 | ETP_API_DECL void ecb_cold |
615 | etp_set_idle_timeout (etp_pool pool, unsigned int seconds) |
615 | etp_set_idle_timeout (etp_pool pool, unsigned int seconds) |
… | |
… | |
618 | pool->idle_timeout = seconds; |
618 | pool->idle_timeout = seconds; |
619 | if (WORDACCESS_UNSAFE) X_UNLOCK (pool->reqlock); |
619 | if (WORDACCESS_UNSAFE) X_UNLOCK (pool->reqlock); |
620 | } |
620 | } |
621 | |
621 | |
622 | ETP_API_DECL void ecb_cold |
622 | ETP_API_DECL void ecb_cold |
623 | etp_set_min_parallel (etp_pool pool, unsigned int nthreads) |
623 | etp_set_min_parallel (etp_pool pool, unsigned int threads) |
624 | { |
624 | { |
625 | if (pool->wanted < nthreads) |
625 | if (pool->wanted < threads) |
626 | pool->wanted = nthreads; |
626 | pool->wanted = threads; |
627 | } |
627 | } |
628 | |
628 | |
629 | ETP_API_DECL void ecb_cold |
629 | ETP_API_DECL void ecb_cold |
630 | etp_set_max_parallel (etp_pool pool, unsigned int nthreads) |
630 | etp_set_max_parallel (etp_pool pool, unsigned int threads) |
631 | { |
631 | { |
632 | if (pool->wanted > nthreads) |
632 | if (pool->wanted > threads) |
633 | pool->wanted = nthreads; |
633 | pool->wanted = threads; |
634 | |
634 | |
635 | while (pool->started > pool->wanted) |
635 | while (pool->started > pool->wanted) |
636 | etp_end_thread (pool); |
636 | etp_end_thread (pool); |
637 | } |
637 | } |
638 | |
638 | |