Skip to content

Commit

Permalink
fix kill-test
Browse files Browse the repository at this point in the history
  • Loading branch information
qinzuoyan committed Oct 23, 2015
1 parent c71157e commit 7f7d270
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/kill_test/client_parallel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
#include <signal.h>
#include <unistd.h>
#include <sys/time.h>
#include <asm/atomic.h>
#include <sofa/pbrpc/pbrpc.h>
#include "echo_service.pb.h"

static volatile bool s_is_running = true;
static volatile bool s_should_wait = false;
static atomic_t s_print_token = ATOMIC_INIT(1);
static sofa::pbrpc::AtomicCounter s_print_token(1);
static sofa::pbrpc::AtomicCounter s_succeed_count(0);
static sofa::pbrpc::AtomicCounter s_pending_count(0);

Expand All @@ -37,15 +36,15 @@ void EchoCallback(
}
else {
s_is_running = false;
if (atomic_dec_and_test(&s_print_token))
if (--s_print_token == 0)
{
SLOG(ERROR, "request failed: %s", cntl->ErrorText().c_str());
}
}
}
else if (request->message() != response->message()) {
s_is_running = false;
if (atomic_dec_and_test(&s_print_token))
if (--s_print_token == 0)
{
SLOG(ERROR, "request failed: response not matched");
}
Expand Down

0 comments on commit 7f7d270

Please sign in to comment.