Skip to content

Commit

Permalink
HAL Notifier: Don't disable the notifier manager when the last handle…
Browse files Browse the repository at this point in the history
… is cleaned up (#960)

- Addresses #959, but not a good long term solution
  • Loading branch information
virtuald authored and PeterJohnson committed Mar 3, 2018
1 parent 979984f commit 1e7d439
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions hal/src/main/native/athena/Notifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,17 @@ void HAL_CleanNotifier(HAL_NotifierHandle notifierHandle, int32_t* status) {
// the notifier can call back into our callback, so don't hold the lock
// here (the atomic fetch_sub will prevent multiple parallel entries
// into this function)
if (notifierAlarm) notifierAlarm->writeEnable(false, status);
if (notifierManager) notifierManager->disable(status);

std::lock_guard<wpi::mutex> lock(notifierMutex);
notifierAlarm = nullptr;
notifierManager = nullptr;
closestTrigger = UINT64_MAX;
// Cleaning up the manager takes up to a second to complete, so don't do
// that here. Fix it more permanently in 2019...

// if (notifierAlarm) notifierAlarm->writeEnable(false, status);
// if (notifierManager) notifierManager->disable(status);

// std::lock_guard<wpi::mutex> lock(notifierMutex);
// notifierAlarm = nullptr;
// notifierManager = nullptr;
// closestTrigger = UINT64_MAX;
}
}

Expand Down

0 comments on commit 1e7d439

Please sign in to comment.