Home » U++ Library support » U++ Widgets - General questions or Mixed problems » ASSERT(IsMainThread());
ASSERT(IsMainThread()); [message #21420] |
Tue, 19 May 2009 13:56 |
|
Hello Mirek!
I have an error on run a builded application in line
from uppsrc/Ctrl/CtrlCore/Win32Wnd.cpp in method void Ctrl::GuiSleep(int ms) .
What i do wrong? some days ago works fine, but after you added this line its prompt error! Tell me how can I change my code?
The situation is: I call a function in a thread instance, and this function works with GUI (progress). I uses this in GoogleTranslator that I call function in thread for translate a text
this is full method:
void Ctrl::GuiSleep(int ms)
{
GuiLock __;
=>HERE ASSERT(IsMainThread());
ELOG("GuiSleep");
if(EndSession())
return;
ELOG("GuiSleep 2");
int level = LeaveGuiMutexAll();
#if !defined(flagDLL) && !defined(PLATFORM_WINCE)
if(!OverwatchThread) {
DWORD dummy;
OverwatchThread = CreateThread(NULL, 0x100000, Win32OverwatchThread, NULL, 0, &dummy);
ELOG("ExitLoopEventWait 1");
ExitLoopEvent().Wait();
}
HANDLE h[1];
*h = ExitLoopEvent().GetHandle();
ELOG("ExitLoopEventWait 2 " << (void *)*h);
MsgWaitForMultipleObjects(1, h, FALSE, ms, QS_ALLINPUT);
#else
MsgWaitForMultipleObjects(0, NULL, FALSE, ms, QS_ALLINPUT);
#endif
EnterGuiMutex(level);
}
Add:
I added GoogleTranslator as example.
After build and run application press Translate button for generate error!
[Updated on: Tue, 19 May 2009 17:11] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu May 09 04:44:10 CEST 2024
Total time taken to generate the page: 0.02764 seconds
|