The UNIX and Linux Forums
>
Top Forums
>
High Level Programming
create a thread from a returning function
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Portal
Register
Rules & FAQ
Contribute
Members List
Arcade
Search
Today's Posts
Mark Forums Read
Thread
:
create a thread from a returning function
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
05-08-2008
ramen_noodle
Registered User
Join Date: Dec 2007
Location: Virginia, USA.
Posts: 232
The reason this is not working is that your main function doesn't have an event loop and/or doesn't block on the created thread.
An easy way out is to return the created thread tid, do not detach, and call pthread_join in main.
HTH.
ramen_noodle
View Public Profile
Find all posts by ramen_noodle