[Groonga-commit] groonga/groonga at 65828eb [master] ctx: use CRITICAL_SECTION_ENTER/LEAVE in grn_ctx_close for thread-safety

Back to archive index

Susumu Yata null+****@clear*****
Mon Mar 14 15:54:58 JST 2016


Susumu Yata	2016-03-14 15:54:58 +0900 (Mon, 14 Mar 2016)

  New Revision: 65828ebf916f140c55b5ad9e37aba64bd72e9abb
  https://github.com/groonga/groonga/commit/65828ebf916f140c55b5ad9e37aba64bd72e9abb

  Message:
    ctx: use CRITICAL_SECTION_ENTER/LEAVE in grn_ctx_close for thread-safety

  Modified files:
    lib/ctx.c

  Modified: lib/ctx.c (+2 -0)
===================================================================
--- lib/ctx.c    2016-03-14 12:34:16 +0900 (c675e8d)
+++ lib/ctx.c    2016-03-14 15:54:58 +0900 (1e33e16)
@@ -1149,8 +1149,10 @@ grn_rc
 grn_ctx_close(grn_ctx *ctx)
 {
   grn_rc rc = grn_ctx_fin(ctx);
+  CRITICAL_SECTION_ENTER(grn_glock);
   ctx->next->prev = ctx->prev;
   ctx->prev->next = ctx->next;
+  CRITICAL_SECTION_LEAVE(grn_glock);
   GRN_GFREE(ctx);
   return rc;
 }
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index