Kouhei Sutou
null+****@clear*****
Wed Dec 9 14:51:37 JST 2015
Kouhei Sutou 2015-12-09 14:51:37 +0900 (Wed, 09 Dec 2015) New Revision: 7c34ce4df6b536c77f516fc4f67cb0e5ed7f2240 https://github.com/groonga/groonga/commit/7c34ce4df6b536c77f516fc4f67cb0e5ed7f2240 Message: groonga: wait until running threads are finished Modified files: src/groonga.c Modified: src/groonga.c (+11 -0) =================================================================== --- src/groonga.c 2015-12-09 12:18:21 +0900 (6184704) +++ src/groonga.c 2015-12-09 14:51:37 +0900 (1fedff1) @@ -507,6 +507,17 @@ groonga_set_thread_limit(uint32_t new_limit, void *data) MUTEX_UNLOCK(q_mutex); } } + + while (GRN_TRUE) { + grn_bool is_reduced; + MUTEX_LOCK_ENSURE(&grn_gctx, q_mutex); + is_reduced = (n_running_threads <= max_n_floating_threads); + MUTEX_UNLOCK(q_mutex); + if (is_reduced) { + break; + } + grn_nanosleep(1000000); + } } static void -------------- next part -------------- HTML����������������������������... Descargar