  void cancel(Mutex* dataLock, void** data) override {
    {
      // cppcheck-suppress redundantPointerOp
      MUTEX_LOCKER(mutexLocker, *dataLock);

      // either we have not yet reached the execute above or we are already done
      if (*data == nullptr) {
        *data = (void*)1;  // mark as canceled
      }

      // data is set, cancel the execution
      else {
        if (!((v8::Isolate*)*data)->IsExecutionTerminating()) {
          ((v8::Isolate*)*data)->TerminateExecution();
        }
      }
    }
  }
  void cancel(Mutex* dataLock, void** data) override {
    {
       
      MUTEX_LOCKER(mutexLocker, *dataLock);

       
      if (*data == nullptr) {
        *data = (void*)1;   
      }

       
      else {
        if (!((v8::Isolate*)*data)->IsExecutionTerminating()) {
          ((v8::Isolate*)*data)->TerminateExecution();
        }
      }
    }
  }