Skip to content

Commit

Permalink
#418 Fixed broken/bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagliughi committed Jul 4, 2024
1 parent 9e378f5 commit 958a618
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
5 changes: 1 addition & 4 deletions include/mqtt/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,7 @@ class token
* Register a listener to be notified when an action completes.
* @param listener The callback to be notified when actions complete.
*/
virtual void set_action_callback(iaction_listener& listener) {
guard g(lock_);
listener_ = &listener;
}
virtual void set_action_callback(iaction_listener& listener);
/**
* Store some context associated with an action.
* @param userContext optional object used to pass context to the
Expand Down
9 changes: 4 additions & 5 deletions src/token.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// token.cpp

/*******************************************************************************
* Copyright (c) 2013-2019 Frank Pagliughi <[email protected]>
* Copyright (c) 2013-2024 Frank Pagliughi <[email protected]>
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
Expand Down Expand Up @@ -257,13 +257,12 @@ void token::reset()
errMsg_.clear();
}

void set_action_callback(iaction_listener& listener)
void token::set_action_callback(iaction_listener& listener)
{
guard g(lock_);
unique_lock g{lock_};
listener_ = &listener;

if (complete_)
{
if (complete_) {
g.unlock();

if (rc_ == MQTTASYNC_SUCCESS)
Expand Down

0 comments on commit 958a618

Please sign in to comment.