ros/ros_comm — pull request #284 by wjwwood (2013-09-20 03:46:11+00:00)
Title: rospy: use threading modules rather than thread

This pull request modifies rospy to eliminate the use of the Python `thread` module and to instead use the Python `threading` module universally. Reasons for doing this:

- Remove usage of deprecated module (must be imported as `_thread` in Python3)
- Allows the coverage tool in python to cover callbacks for services in rospy

For more information about the coverage bug with the `thread` modules, see:

https://bitbucket.org/ned/coveragepy/issue/244/coverage-doesnt-work-with-thread-not

I mostly replace lines like:

```python
import thread
...
thread.start_new_thread(func, (arg1, arg2))
```

With sections like this:

```python
import threading
...
threading.Thread(target=func, args=(arg1, arg2)).start()
```

Not keeping a reference to the Thread object after creation appears to be OK, according to this to this website:

http://bytes.com/topic/python/answers/160905-my-thread-safe-premature-garbage-collection