Beispiel #1
0
static void
snmpmgr_thread_finally_called(
  const lagopus_thread_t *thd, bool is_canceled,
  void *arg) {
  bool is_valid = false;
  lagopus_result_t ret;
  (void) is_canceled;
  (void) arg;

  if (*thd != snmpmgr) {
    lagopus_exit_fatal("other threads worked, argument is :%p, snmpmgr is :%p\n",
                       *thd, snmpmgr);
  }

  ret = lagopus_thread_is_valid(&snmpmgr, &is_valid);
  if (ret != LAGOPUS_RESULT_OK || is_valid == false) {
    lagopus_perror(ret);
    return;
  }

  (void)lagopus_mutex_unlock(&snmp_lock);
  (void)lagopus_mutex_unlock(&snmp_state_lock);

  (void)lagopus_mutex_lock(&snmp_state_lock);
  state = SNMPMGR_NONE;
  (void)lagopus_mutex_unlock(&snmp_state_lock);

  global_state_cancel_janitor();
}
Beispiel #2
0
void
dp_thread_finalize(lagopus_thread_t *threadptr) {
  bool is_valid = false, is_canceled = false;
  lagopus_result_t ret;

  ret = lagopus_thread_is_valid(threadptr, &is_valid);
  if (ret != LAGOPUS_RESULT_OK || is_valid == false) {
    lagopus_perror(ret);
    return;
  }
  ret = lagopus_thread_is_canceled(threadptr, &is_canceled);
  if (ret == LAGOPUS_RESULT_OK && is_canceled == false) {
    global_state_cancel_janitor();
  }
  lagopus_thread_destroy(threadptr);

  return;
}
Beispiel #3
0
static void
s_finalize(const gallus_thread_t *tptr, bool is_canceled, void *arg) {
  (void)arg;

  if (tptr != NULL) {
    null_thread_t nptr = (null_thread_t)*tptr;

    if (nptr != NULL) {

      gallus_msg_debug(1, "called, %s.\n",
                        (is_canceled == true) ? "canceled" : "exit");
      if (is_canceled == true) {
        global_state_cancel_janitor();
      }

    }
  }
}
Beispiel #4
0
static void
s_dummy_thd_finalize(const lagopus_thread_t *tptr, bool is_canceled,
                     void *arg) {
  (void)tptr;
  (void)arg;

  if (is_canceled == true) {
    if (s_is_started == false) {
      /*
       * Means this thread is canceled while waiting for the global
       * state change.
       */
      global_state_cancel_janitor();
    }
  }

  lagopus_msg_debug(5, "called, %s.\n",
                    (is_canceled == true) ? "canceled" : "exited");
}