我怎样才能杀死线程和孩子的?
i killing the parent thread but children threads are not killed.
我通过这段代码创建线程:
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_create(&posixThreadID, &attr, &threadFunc, "void");
杀死:
pthread_cancel(posixThreadID);