コード例 #1
0
void system_init(system_t* system)
{
	system->cur_time = -1;
	system->cpu_count = 1;

	system->work_queue = queue_make();
	system->ready_queue = queue_make();
	system->terminate_queue = queue_make();

	memset(system->pcb_on_cpu, 0x00, sizeof(system->pcb_on_cpu));
	memset(pcb_on_cpu_prev, 0x00, sizeof(pcb_on_cpu_prev));
}
コード例 #2
0
ファイル: testlib.c プロジェクト: netguy204/gambit-game-lib
void lib_init() {
  clock_allocator = fixed_allocator_make(sizeof(struct Clock_), MAX_NUM_CLOCKS, "clock_allocator");
  image_resource_allocator = fixed_allocator_make(sizeof(struct ImageResource_), MAX_NUM_IMAGES, "image_resource_allocator");
  frame_allocator = stack_allocator_make(1024 * 1024, "frame_allocator");
  command_allocator = fixed_allocator_make(sizeof(struct Command_), MAX_NUM_COMMANDS, "command_allocator");
  render_queue = queue_make();
  render_barrier = threadbarrier_make(2);

  native_init();

  renderer_running = 1;
  pthread_create(&renderer_thread, NULL, renderer_exec, NULL);

  // let the renderer finish init
  renderer_enqueue_sync(renderer_init, NULL);

  // kick off the audio system
  audio_init();

  scm_init();
}