Code not working in new thread
| Tue, 2008-07-01 14:27 | |
|
Hi all, void CCameraMotion::UpdateMHI(CFbsBitmap *iCurFrame)One thing that I found out was that the new thread needs a connection to the Font and Bitmap server. This can be done with the following command: User::LeaveIfError(RFbsSession::Connect()); With this it works until the second if-else-statement but the application gets stuck at the command iMhi->AddImage(*tmp). Many thanks for your help Marcel |
|






Forum posts: 120
it seems you are using main process's heap which is somehow not accessible. You can try creating a threads own heap address space and then try executing the same code.
Jupitar
Forum posts: 1197
There is no such thing as the "main process's heap", all heaps are assigned to threads, and all memory is always shared between all threads in the same process. (That is after all the definition of what differs a thread from a process)
My question is, what is this "MHI" thing, and have you created and initialized it in the current (new) thread? (I'm not familiar with the NokiaCV example)
Maybe it too needs a connection to something, and then you have to create/connect it in the thread where you want to use it.
Forum posts: 120
yes alh you are right. I think i mexed client-server & thread concepts toghether. sorry for the confusion created.
Jupitar
Forum posts: 4
Hi,
thanks for your replies.
I solved the problem by defining the iMhi and iMhiImage as local method variables and letting the UpdateMhi() function run forever. It is then controlled by the Rthread.Suspend and Rthread.Resume functions.
Greetings
Marcel