Kouhei Sutou
null+****@clear*****
Wed Dec 9 11:53:11 JST 2015
Kouhei Sutou 2015-12-09 11:53:11 +0900 (Wed, 09 Dec 2015) New Revision: d33d94e8d7a712c3e8bcd7c136c1bbbe568d0193 https://github.com/groonga/groonga/commit/d33d94e8d7a712c3e8bcd7c136c1bbbe568d0193 Message: Add missing decrement on error Modified files: src/groonga.c Modified: src/groonga.c (+8 -2) =================================================================== --- src/groonga.c 2015-12-09 11:46:04 +0900 (2dcd9d6) +++ src/groonga.c 2015-12-09 11:53:11 +0900 (4cb5add) @@ -2003,7 +2003,10 @@ h_handler(grn_ctx *ctx, grn_obj *msg) if (!n_floating_threads && n_running_threads < max_n_floating_threads) { grn_thread thread; n_running_threads++; - if (THREAD_CREATE(thread, h_worker, arg)) { SERR("pthread_create"); } + if (THREAD_CREATE(thread, h_worker, arg)) { + n_running_threads--; + SERR("pthread_create"); + } } COND_SIGNAL(q_cond); MUTEX_UNLOCK(q_mutex); @@ -2111,7 +2114,10 @@ g_dispatcher(grn_ctx *ctx, grn_edge *edge) if (!n_floating_threads && n_running_threads < max_n_floating_threads) { grn_thread thread; n_running_threads++; - if (THREAD_CREATE(thread, g_worker, NULL)) { SERR("pthread_create"); } + if (THREAD_CREATE(thread, g_worker, NULL)) { + n_running_threads--; + SERR("pthread_create"); + } } COND_SIGNAL(q_cond); } -------------- next part -------------- HTML����������������������������...ダウンロード