This commit is contained in:
mutouyun 2019-01-24 23:13:15 +08:00
parent b2e48fc138
commit 67972a8c7c
2 changed files with 3 additions and 1 deletions

View File

@ -48,8 +48,8 @@ public:
void close() { void close() {
if (!valid()) return; if (!valid()) return;
w_->close(h_);
::printf("close %p\n", h_); ::printf("close %p\n", h_);
w_->close(h_);
h_ = waiter_t::invalid(); h_ = waiter_t::invalid();
} }

View File

@ -75,8 +75,10 @@ public:
if (h == invalid()) return; if (h == invalid()) return;
auto w = waiter_cast(h); auto w = waiter_cast(h);
if (w->counter_.fetch_sub(1, std::memory_order_acq_rel) == 1) { if (w->counter_.fetch_sub(1, std::memory_order_acq_rel) == 1) {
::printf("destroy...\n");
::pthread_cond_destroy (&(w->cond_ )); ::pthread_cond_destroy (&(w->cond_ ));
::pthread_mutex_destroy(&(w->mutex_)); ::pthread_mutex_destroy(&(w->mutex_));
::printf("destroy end...\n");
} }
} }