Skip to content

Commit

Permalink
Name is better as unregister
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu committed Dec 13, 2024
1 parent c52016c commit 6219819
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/nrncvode/netcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class WatchCondition: public ConditionEvent {
static unsigned long watch_send_;
static unsigned long watch_deliver_;

signal_<WatchCondition*> del;
signal_<WatchCondition*> unregister;
};

class STECondition: public WatchCondition {
Expand Down
12 changes: 6 additions & 6 deletions src/nrncvode/netcvode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2325,7 +2325,7 @@ void _nrn_watch_activate(Datum* d,
}
if (r == 0) {
for (auto wc1: *wl) {
wc1->del.send(wc1);
wc1->unregister.send(wc1);
if (wc1->qthresh_) { // is it on the queue?
net_cvode_instance->remove_event(wc1->qthresh_, PP2NT(pnt)->id);
wc1->qthresh_ = nullptr;
Expand Down Expand Up @@ -2443,7 +2443,7 @@ void _nrn_free_watch(Datum* d, int offset, int n) {
}
for (i = offset + 1; i < nn; ++i) {
if (auto* wc = d[i].get<WatchCondition*>(); wc) {
wc->del.send(wc);
wc->unregister.send(wc);
delete wc;
d[i] = nullptr;
}
Expand Down Expand Up @@ -5246,7 +5246,7 @@ WatchCondition::WatchCondition(Point_process* pnt, double (*c)(Point_process*))
}

WatchCondition::~WatchCondition() {
del.send(this);
unregister.send(this);
}

// A WatchCondition but with different deliver
Expand Down Expand Up @@ -5277,9 +5277,9 @@ void WatchCondition::activate(double flag) {
wl = new std::list<WatchCondition*>();
net_cvode_instance->wl_list_[id].push_back(wl);
}
del.send(this);
unregister.send(this);
wl->push_back(this);
del.connect([&](WatchCondition* wc) {
unregister.connect([&](WatchCondition* wc) {
auto it = std::find(wl->begin(), wl->end(), wc);
if (it != wl->end()) {
wl->erase(it);
Expand Down Expand Up @@ -5353,7 +5353,7 @@ void STETransition::deactivate() {
net_cvode_instance->remove_event(stec_->qthresh_, stec_->thread()->id);
stec_->qthresh_ = nullptr;
}
stec_->del.send(stec_.get());
stec_->unregister.send(stec_.get());
}

void STECondition::deliver(double tt, NetCvode* ns, NrnThread* nt) {
Expand Down

0 comments on commit 6219819

Please sign in to comment.