×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    58

    RThread Cloes problems

    Hi,i would like to ask how can i know when the threads is complete?
    Example:
    TBuf<32> threadName;
    TInt iThreadCount=5;
    while(iThreadCount>0)
    {
    //Create 5 different thread.
    threadName.AppendFormat(_L("Thread%d"),iThreadCount);
    iThread =RThread();//Get the handler of main thread.
    iThread.Create(threadName,ThreadFunction,4096,KMinHeapSize,
    256*KMinHeapSize,this);
    iThread.Resume;
    iThreadCount--;
    }
    Here i create 5 different thread use the same function,with iThread, how can i know are Thread1/Thread2/Thread3 completed;


    TBool IsAlive(thread id or thread name)
    {
    TBool alive = EFalse;
    RThread thread;
    TInt err = thread.Open(thread id or thread name);
    if(err==KErrNone)
    {
    TExitType exitType = thread.ExitType();
    if(exitType==EExitPending) // thread is still alive
    {
    alive = ETrue;
    }
    }
    return alive;
    }
    I know this method can get the exittype of iThread,
    I just want to know if i use this way:
    TInt err = iThread.Open(Thread1);
    if(err==KErrNone)
    {
    TExitType exitType = iThread.ExitType();
    if(exitType==EExitPending) // thread is still alive
    {
    alive = ETrue;
    }
    }
    The status is Thread1's status?
    Last edited by kunlamp; 2009-11-26 at 15:21.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,752

    Re: RThread Cloes problems

    Quote Originally Posted by kunlamp View Post
    The status is Thread1's status?
    Yes, it is.
    Using RThread::Logon would be nicer.

  3. #3
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    58

    Re: RThread Cloes problems

    Thanks wizard_hu_

Similar Threads

  1. Several problems with NMIT 4.1
    By jtalviva in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-03-10, 10:59
  2. Series 60 CustomItem implementation problems?
    By fotis.chatzinikos in forum Mobile Java General
    Replies: 2
    Last Post: 2005-03-10, 15:48
  3. Problems with Developer Suite 2.2 and PC Suite 6.41.6
    By caiox in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-02-20, 18:53
  4. NGage devkit problems
    By cambion in forum Symbian
    Replies: 3
    Last Post: 2004-12-07, 07:50

Posting Permissions

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