示例#1
0
void yThreadKill(yThread *yth)
{
    if (yThreadIsRunning(yth)) {
#ifdef WINDOWS_API
        //means thread still running lets give it some time
        if (!yWaitForEvent(&yth->th, 1000)) {
            yKillThread(&yth->th);
        }
#else
        yKillThread(&yth->th);
#endif
    } else {
        yWaitEndThread(&yth->th);
        yReleaseDetachedThreadEx(&yth->th);
    }
}
示例#2
0
int    yThreadWaitEnd(yThread *yth)
{
	int res = yWaitEndThread(&yth->th);   
	yReleaseDetachedThreadEx(&yth->th);
	return res;
}