Question about Thread

49 views
Skip to first unread message

Gordons

unread,
Sep 6, 2013, 12:43:46 PM9/6/13
to codenameone...@googlegroups.com
Is there a way I can find out if a thread is already running so I do not call it to run a second time. I tried using

    thread.isAlive()?

but it ignores it and calls the thread again.

Shai Almog

unread,
Sep 6, 2013, 1:31:42 PM9/6/13
to codenameone...@googlegroups.com
Not really, just use a marker flag when entering run() and when exiting it (make sure to have a finally block).

Gordons

unread,
Sep 6, 2013, 2:28:19 PM9/6/13
to codenameone...@googlegroups.com
Ok thanks.
Reply all
Reply to author
Forward
0 new messages