jit::StackPersistStage::StackPersistStage(VariableContainer& container, op::ProcessorOpCodeSet& jit_opcodes)
  : variables_(container),
    jit_opcodes_(jit_opcodes) {

  variables_.subscribe_on_insert([&](int variable_number) {
    on_insert(variable_number);
  });

  variables_.subscribe_on_persist([&](int variable_number) {
    persist_variable(variable_number);
  });
}
Esempio n. 2
0
static gint
animation_timer (gpointer data)
{
  switch (g_random_int_range (0, 3)) 
    {
    case 0: 
      on_insert ();
      break;
    case 1:
      on_delete ();
      break;
    case 2:
      on_reorder ();
      break;
    }

  n_animations--;
  return n_animations > 0;
}
Esempio n. 3
0
//-----------------------------------------------------------------------------
// This is called by the writer thread, and doesn't return until the SD
// is in a known state, the inital header is written out, and all is ready to
// go for normal writing. It will exit if we have requested the thread should
// terminate (for shutdown)
static uint8_t
wait_for_sd(void)
{
	uint8_t sd_det_count = POLLING_COUNT;
	while(1)
	{
		if (chThdShouldTerminateX())
		{
			logger_state = LS_EXITING;
			break;
		}

		if (sdc_lld_is_card_inserted(&SDCD1))
		{
			if (--sd_det_count == 0)
			{
				if ( on_insert() == KB_OK )
				{
					break;
				}
				else
				{
					sd_det_count = POLLING_COUNT;
					continue;
				}
			}
		}
		else
		{
			kbs_setFName(KUROBOX_BLANK_FNAME);
			sd_det_count = POLLING_COUNT;
		}
		chThdSleepMilliseconds(POLLING_DELAY);
	}
	return KB_OK;
}