Article # 202, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
Limitations to using ThreadDestroy in GOC.
ThreadDestroy and its C stub should never be called from a movable resource, or from a fixed resource that is called (indirectly) from some movable resource, as ThreadDestroy does not return to its caller and all the movable resources in the calling stack will be left locked forever. The solution is to never call ThreadDestroy. Instead, use ThreadCreate to begin executing a certain routine. When that routine is finished, the system will call ThreadDestroy to get rid of the thread for you. The above is only true for procedural threads created using ThreadCreate. For event-driven threads created with MSG_PROCESS_CREATE_EVENT_THREAD you should send MSG_META_QUIT to the new thread to destroy it. You can send the message from the same thread or from a different thread.