 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
Kintar
Joined: 11 Jan 2008 Posts: 8
Digg It |
Posted: Tue Jan 15, 2008 1:52 pm Post subject: Feature Request |
|
|
Hey, Cha0s. If you've got time, one thing that would be really cool in the next version of WiiRemoteJ would be something that lets the WiiRemote's worker threads shut down when the remote disconnects. One of the project I'm fiddling with will require that the remote be an optional device, even being disconnected in the middle of a run, only to be reconnected later. I've noticed that there's something hanging on out there when the remote is disconnected, both through the WiiRemote.disconnect() call, and if the remote is powered down via its power button, leaving the possibility of a bunch of threads dangling out on the edges of nowhere until a System.exit() is called.
Oh, and if I'll certainly admit to the possibility of missing something in the documentation and causing this issue on my own, so let me know if that's the case.
-- Kintar |
|
| Back to top |
|
 |
Cha0s Site Admin
Joined: 17 Jan 2007 Posts: 495
Digg It |
Posted: Tue Jan 15, 2008 4:28 pm Post subject: |
|
|
I'm pretty sure that all the threads kill themselves. The main listener thread has special instructions on how to kill itself gracefully. Any other active threads will probably throw exceptions when the remote is disconnected and die peacefully after that. There are only two threads that loop, one being the listener and one being the readSoundData thread. However, the latter thread would also throw an exception if the remote disconnected mid-sound-playing. AND, it also has as one of the conditions of the loop, "connected," so it should definitely go away. I don't think there should be anything left after a disconnect. I could be missing a thread somewhere, but I'm pretty sure that's all of them. It may be that they just haven't been cleaned up by garbage collection. Try calling Runtime.getRuntime().gc() and see if they go away then. _________________ Cha0s |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|