×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    26

    Active Object and RequestComplete() leads to forever loop

    I´ve two threads in my program. There´s need to tell UI when to update from the other thread. I have implemented an AO to my UI thread.

    The other thread calls RThread::RequestComplete() -function that works fine, the active objects RunL() gets called.

    Here is the code in my AO RunL()

    if(iStatus == KErrNone)
    {
    iContainer->UpdateView();
    SetActive();
    }

    but when there´s SetActive() function call, the RunL() is called continuosly, it leaves to forever loop. Why this happens? What I need to do that I´ll get this work.

    If I take SetActive() -call away and the RequestComplete gets called twice the program of course crashes...

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    Helsinki
    Posts
    22
    The status of the active object needs to be set to KRequestPending.

    <code>
    iOtherThread.DoSomething();
    iStatus = KRequestePending;
    SetActive();
    </code>

    -- Wolfgang

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×