diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-05-16 19:20:58 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-05-16 19:20:58 +0300 |
commit | d7e0d11445cd9972ac6f20e39878e3dc8bc7fe12 (patch) | |
tree | cef6ba1a77463399bbc9c5f194f8593b9db7b7f9 /src | |
parent | 5c610b8ec15a535bc70a37ba451aa07519a625dc (diff) | |
download | wydawca-d7e0d11445cd9972ac6f20e39878e3dc8bc7fe12.tar.gz wydawca-d7e0d11445cd9972ac6f20e39878e3dc8bc7fe12.tar.bz2 |
Bugfix
* src/triplet.c (triplet_enqueue): Create thread in detached state.
Diffstat (limited to 'src')
-rw-r--r-- | src/triplet.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/triplet.c b/src/triplet.c index 627931e..686702a 100644 --- a/src/triplet.c +++ b/src/triplet.c @@ -340,6 +340,8 @@ triplet_enqueue(struct wy_triplet *trp) { pthread_t tid; struct spool *spool; + pthread_attr_t attr; + if (!trp) return; spool = trp->spool; @@ -357,7 +359,11 @@ triplet_enqueue(struct wy_triplet *trp) triplet_list_insert(&triplet_running_list, trp, NULL, 1); triplet_list_unlock(&triplet_running_list); trp->in_processing = 1; - pthread_create(&tid, NULL, wy_thr_triplet, trp); + + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + pthread_create(&tid, &attr, wy_thr_triplet, trp); + pthread_attr_destroy(&attr); break; case triplet_incomplete: break; |