예제 #1
0
extern "C" void MainTask(void *pvParameters)
{
	mallocMutex.Create("Malloc");
	spiMutex.Create("SPI");
	i2cMutex.Create("I2C");
#endif
	reprap.Init();
	for (;;)
	{
		reprap.Spin();
	}
}
예제 #2
0
파일: system.cpp 프로젝트: SinSiXX/scummvm
OSystem::MutexRef TizenMutexManager::createMutex() {
	Mutex *mutex = new Mutex();
	mutex->Create();

	for (int i = 0; i < MUTEX_BUFFER_SIZE; i++) {
		if (_buffer[i] == NULL) {
			_buffer[i] = mutex;
			break;
		}
	}

	return (OSystem::MutexRef) mutex;
}
예제 #3
0
unsigned __stdcall _OpMsgLoopThread(void *pVoid) {

  OPERATIONSTRUCT os = *reinterpret_cast<POPERATIONSTRUCT>(pVoid);

  delete pVoid;

  ProgressDlg dlg;

  if (!dlg.Create(static_cast<HINSTANCE>(g_hModule),
                  MAKEINTRESOURCE(IDD_COPYMOVE),
                  NULL))
  {

    MessageBox(os.hWnd,
               _T("Failed to create dialog!"),
               _T("extFileCopy : ERROR"),
               MB_OK | MB_ICONSTOP);

    _endthreadex(1U);

    return 1U;
  }

  Mutex m;

  if (!m.Create(NULL, FALSE, _T("extFileCopy"))) {

    MessageBox(os.hWnd,
               _T("A fatal internal error has occurred.")
               _T(" Cannot continue."),
               _T("extFileCopy : ERROR"),
               MB_OK | MB_ICONSTOP);

    _endthreadex(1U);
    return 1U;
  }

  dlg.SetMutex(&m);
  dlg.Show();

  HANDLE hMoveThread = NULL;
  UINT uiCopyThread  = 0U;

  os.pMutex = &m;
  os.pDlg   = &dlg;

  hMoveThread = reinterpret_cast<HANDLE>(_beginthreadex(NULL, 0, _OpFileMoveThread, 
                                                        &os, 0, &uiCopyThread));

  if (NULL == hMoveThread) {

    MessageBox(os.hWnd,
               _T("Failed to spawn worker thread!"),
               _T("extFileCopy : ERROR"),
               MB_OK | MB_ICONSTOP);

    _endthreadex(1U);

    return 1U;
  }

  MSG msg = {0};

  while (GetMessage(&msg, NULL, 0U, 0U)) {

    TranslateMessage(&msg);
    DispatchMessage(&msg);

  }

  _endthreadex(static_cast<UINT>(msg.wParam));
  return 0U;
}
예제 #4
0
void CreateUIMutex()
{
	uiMutex.Create("UIMutex");
}
예제 #5
0
파일: Thread.cpp 프로젝트: J-d-H/Kore
void Kore::threadsInit() {
	mutex.Create();
	//ia.Create(1);//SR_MAX_THREADS32);
}
예제 #6
0
		Mutex_ThreadData()
			:counter(0)
		{
			TEST_ASSERT(mutex.Create(true));
		}