[Groonga-commit] groonga/groonga at 9c9112c [master] request_canceler: unregistr timer on cancel

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Apr 3 01:07:28 JST 2016


Kouhei Sutou	2016-04-03 01:07:28 +0900 (Sun, 03 Apr 2016)

  New Revision: 9c9112c1f4acd1b56bd59758cca2595eca2198e2
  https://github.com/groonga/groonga/commit/9c9112c1f4acd1b56bd59758cca2595eca2198e2

  Message:
    request_canceler: unregistr timer on cancel

  Modified files:
    lib/request_canceler.c

  Modified: lib/request_canceler.c (+6 -0)
===================================================================
--- lib/request_canceler.c    2016-04-03 01:07:04 +0900 (dade736)
+++ lib/request_canceler.c    2016-04-03 01:07:28 +0900 (9ffe1f4)
@@ -17,6 +17,7 @@
 */
 
 #include "grn_ctx.h"
+#include "grn_ctx_impl.h"
 #include "grn_request_canceler.h"
 
 typedef struct _grn_request_canceler grn_request_canceler;
@@ -101,6 +102,11 @@ grn_request_canceler_cancel_entry(grn_request_canceler_entry *entry)
 {
   if (entry->ctx->rc == GRN_SUCCESS) {
     entry->ctx->rc = GRN_CANCEL;
+    if (entry->ctx->impl->current_request_timer_id) {
+      void *timer_id = entry->ctx->impl->current_request_timer_id;
+      entry->ctx->impl->current_request_timer_id = NULL;
+      grn_request_timer_unregister(timer_id);
+    }
     return GRN_TRUE;
   } else {
     return GRN_FALSE;
-------------- next part --------------
HTML����������������������������...
Télécharger 



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