|
|
|
@ -668,13 +668,31 @@ int thr_info_create(struct thr_info *thr, pthread_attr_t *attr, void *(*start) (
@@ -668,13 +668,31 @@ int thr_info_create(struct thr_info *thr, pthread_attr_t *attr, void *(*start) (
|
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void thr_info_cancel(struct thr_info *thr) |
|
|
|
|
void thr_info_freeze(struct thr_info *thr) |
|
|
|
|
{ |
|
|
|
|
struct tq_ent *ent, *iter; |
|
|
|
|
struct thread_q *tq; |
|
|
|
|
|
|
|
|
|
if (!thr) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if (thr->q) |
|
|
|
|
tq_freeze(thr->q); |
|
|
|
|
tq = thr->q; |
|
|
|
|
if (!tq) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
mutex_lock(&tq->mutex); |
|
|
|
|
tq->frozen = true; |
|
|
|
|
list_for_each_entry_safe(ent, iter, &tq->q, q_node) { |
|
|
|
|
list_del(&ent->q_node); |
|
|
|
|
free(ent); |
|
|
|
|
} |
|
|
|
|
mutex_unlock(&tq->mutex); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void thr_info_cancel(struct thr_info *thr) |
|
|
|
|
{ |
|
|
|
|
if (!thr) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if (PTH(thr) != 0L) { |
|
|
|
|
pthread_cancel(thr->pth); |
|
|
|
|