Updating the examples for thread

Updating the examples for thread