console and threads
| Thu, 2006-03-16 09:33 | |
|
I have a simple application which tries to use a console->Printf from another thread created by the same application. It seems not to be possible as application crashes on that with KERN-EXEC 0.
relevant part of the app itself: LOCAL_C void doExampleL() { _LIT(KHelloWorldText,"Hello TestConsole3!\n"); console->Printf(KHelloWorldText); DoThreadConsoleTest(); } void TestPrintf(const TPtrC msg); static TInt threadFunc(TAny *data); void DoThreadConsoleTest() { RThread th; th.Create(_L("ConsoleTestThread"),(TThreadFunction)threadFunc, 4096,KMinHeapSize,KMinHeapSize*2,(TAny*)NULL); th.Resume(); } TInt threadFunc(TAny*) { for(TInt i=0; i<25; i++) { TestPrintf(_L("I print now")); User::After(100*1000); } return 0; } void TestPrintf(const TPtrC msg) { console->Printf(msg); } Ahti. |
|






Forum posts: 75
-Slava
Forum posts: 47
ok, have to admin, that according to a test it is not so: opened an handle in one thread, it crashed if trying to use it at another
Ahti.
Forum posts: 47
----
By default, any thread in the process can use this handle to access the kernel side object that the handle represents
----
But simple application crashes if thread tries to write to a file opened by another thread.
?
Ahti.
Forum posts: 47
Ahti.