Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User Zhang Jianliang's Avatar
    Join Date
    Jul 2008
    Posts
    20
    In midp2.0, Thread.getState() is not usable. Then is there an alternative way to get the state of a thread? like blocked,live or dead.
    Thanks

  2. #2
    Nokia Developer Moderator r2j7's Avatar
    Join Date
    Aug 2007
    Posts
    1,595
    Hello Zhang Jianliang,

    based on: http://developers.sun.com/mobility/m...es/threading2/

    "J2ME provides two variants of the Thread class, both subsets of the J2SE version 1.3. CLDC's Thread class includes only these methods:

    activeCount()
    currentThread()
    getPriority()
    isAlive()
    join()
    run()
    setPriority()
    sleep()
    start()
    yield()
    ..
    Your code can obtain access to the current thread's instance of Thread at any time by invoking Thread.currentThread().
    ..
    Once one thread has "asked" another thread to stop, the first thread can see whether the second is still alive by calling its isAlive() method. "

    Regards,
    r2j7

  3. #3
    Registered User Zhang Jianliang's Avatar
    Join Date
    Jul 2008
    Posts
    20
    Hello r2j7:
    "isAlive" includes two states: blocked and running.
    Then how can i judge whether a thread is blocked in socket communication situation.
    Thanks

  4. #4
    Registered User anjan_singha's Avatar
    Join Date
    Jan 2008
    Location
    Pune
    Posts
    24
    Hi Zhang Jianliang,
    In case if u r using notify(); on running thread then isAlive() will return false on this Thread object.
    But its bit difficult to judge whether a thread is blocked in socket communication even I am also trying to find the solution.

    All best
    Anjan

Similar Threads

  1. S60 SDK 3rd edition FP1 Emulator problem
    By justteam in forum Symbian Tools & SDKs
    Replies: 14
    Last Post: 2010-03-23, 08:47
  2. console app running problem
    By xcompass in forum Symbian C++
    Replies: 3
    Last Post: 2009-05-08, 13:26
  3. Carbide C++ : ..... .pkg does not exist. Skipping...
    By satishkatta in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 144
    Last Post: 2008-08-07, 11:16
  4. Need Help with thread
    By gigglie in forum Symbian C++
    Replies: 0
    Last Post: 2008-06-20, 06:39
  5. Link errors when trying to Display bitmap
    By Bkc82 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2006-01-16, 22:46

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