code: private void syncContext(boolean isInit)
      {
      	// jmeter context synchronisation
      	JMeterContext current = JMeterContextService.getContext();
  		JMeterContext ctx = this.getThreadContext();
  		
  		if (isInit)
  		{
  			current.setCurrentSampler(ctx.getCurrentSampler());
  			current.setEngine(ctx.getEngine());
  			current.setRestartNextLoop(ctx.isRestartNextLoop());
  			current.setSamplingStarted(ctx.isSamplingStarted());
  			current.setThread(ctx.getThread());
  			current.setThreadGroup(ctx.getThreadGroup());
  			current.setThreadNum(ctx.getThreadNum());
  		}
  		current.setVariables(ctx.getVariables());
  		current.setPreviousResult(ctx.getPreviousResult());
  		//current.getSamplerContext().putAll(ctx.getSamplerContext());
      }
docs: Update the worker thread jmeter context with the main thread one
  @param isInit if true the context a full copy is done, if false only update is done