Use pthread_kill instead of pthread_cancel for compatibility
PATCH 1/1 Use pthread_kill instead of pthread_cancel for compatibility
pthread_kill is supported on more platforms. For example, android's bionic libc does not have pthread_cancel. Since pthread_setcancelstate() is not used in erofs-utils workqueue code, pthread_cancel has identical behavior to pthread_kill, this switch should be safe.
Signed-off-by Kelvin Zhang <[email protected]>
--- lib/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/workqueue.c +1 -1
@@ -69,7 +69,7 @@ int erofs_alloc_workqueue(struct erofs_workqueue *wq, unsigned int nworker, ret =pthread_create (&wq->workers[i],NULL , worker_thread, wq);if (ret) {while (i) -pthread_cancel (wq->workers[--i]); +pthread_kill (wq->workers[--i]);free (wq->workers);return ret; }
Signature · 1 line
2.46.1.824.gd892dcdcdd-goog