Switches all notifiers created with the external API to be threaded (#546)

Testing showed this wasn't an issue with timing, and allows for more
safety in user code making mistakes. Places where the extra thread
wouldn't help have been kept non threaded, using a new internal API.
This commit is contained in:
Thad House
2017-06-30 18:58:58 -07:00
committed by Peter Johnson
parent 1d15fcd072
commit c57a7f0a41
5 changed files with 28 additions and 10 deletions

View File

@@ -18,6 +18,7 @@
#include "HAL/cpp/Log.h"
#include "edu_wpi_first_wpilibj_hal_NotifierJNI.h"
#include "support/SafeThread.h"
#include "HAL/cpp/NotifierInternal.h"
using namespace frc;
@@ -147,7 +148,8 @@ Java_edu_wpi_first_wpilibj_hal_NotifierJNI_initializeNotifier(
notify->Start();
notify->SetFunc(env, func, mid);
int32_t status = 0;
HAL_NotifierHandle notifierHandle = HAL_InitializeNotifier(notifierHandler, notify, &status);
HAL_NotifierHandle notifierHandle =
HAL_InitializeNotifierNonThreadedUnsafe(notifierHandler, notify, &status);
NOTIFIERJNI_LOG(logDEBUG) << "Notifier Handle = " << notifierHandle;
NOTIFIERJNI_LOG(logDEBUG) << "Status = " << status;