本文整理汇总了C++中Mutex::Create方法的典型用法代码示例。如果您正苦于以下问题:C++ Mutex::Create方法的具体用法?C++ Mutex::Create怎么用?C++ Mutex::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mutex
的用法示例。
在下文中一共展示了Mutex::Create方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MainTask
extern "C" void MainTask(void *pvParameters)
{
mallocMutex.Create("Malloc");
spiMutex.Create("SPI");
i2cMutex.Create("I2C");
#endif
reprap.Init();
for (;;)
{
reprap.Spin();
}
}
示例2: createMutex
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: _OpMsgLoopThread
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: CreateUIMutex
void CreateUIMutex()
{
uiMutex.Create("UIMutex");
}
示例5: threadsInit
void Kore::threadsInit() {
mutex.Create();
//ia.Create(1);//SR_MAX_THREADS32);
}
示例6:
Mutex_ThreadData()
:counter(0)
{
TEST_ASSERT(mutex.Create(true));
}