Added test cases for return in threads/processes