Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor kunlamp's Avatar
    Join Date
    Aug 2009
    Posts
    58
    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 wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    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 kunlamp's Avatar
    Join Date
    Aug 2009
    Posts
    58
    Thanks wizard_hu_

Similar Threads

  1. Several problems with NMIT 4.1
    By jtalviva in forum Mobile Web Site Development
    Replies: 1
    Last Post: 2006-03-20, 13:00
  2. Several problems with NMIT 4.1
    By jtalviva in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-03-10, 10:59
  3. Series 60 CustomItem implementation problems?
    By fotis.chatzinikos in forum Mobile Java General
    Replies: 2
    Last Post: 2005-03-10, 15:48
  4. 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
  5. NGage devkit problems
    By cambion in forum Symbian C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved