From ec35afdc7fa165e2e5af8680672f57a37d359599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 10 Oct 2023 15:26:03 +0200 Subject: [PATCH] chore: remove C-Thread-Pool/example.c (#259) --- C-Thread-Pool/example.c | 40 ---------------------------------------- frankenphp.go | 2 +- 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 C-Thread-Pool/example.c diff --git a/C-Thread-Pool/example.c b/C-Thread-Pool/example.c deleted file mode 100644 index 22ea241fb..000000000 --- a/C-Thread-Pool/example.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * WHAT THIS EXAMPLE DOES - * - * We create a pool of 4 threads and then add 40 tasks to the pool(20 task1 - * functions and 20 task2 functions). task1 and task2 simply print which thread is running them. - * - * As soon as we add the tasks to the pool, the threads will run them. It can happen that - * you see a single thread running all the tasks (highly unlikely). It is up the OS to - * decide which thread will run what. So it is not an error of the thread pool but rather - * a decision of the OS. - * - * */ - -#include -#include -#include -#include "thpool.h" - -void task(void *arg){ - printf("Thread #%u working on %d\n", (int)pthread_self(), (int) arg); -} - - -int main(){ - - puts("Making threadpool with 4 threads"); - threadpool thpool = thpool_init(4); - - puts("Adding 40 tasks to threadpool"); - int i; - for (i=0; i<40; i++){ - thpool_add_work(thpool, task, (void*)(uintptr_t)i); - }; - - thpool_wait(thpool); - puts("Killing threadpool"); - thpool_destroy(thpool); - - return 0; -} diff --git a/frankenphp.go b/frankenphp.go index 7f227e2a8..102106551 100644 --- a/frankenphp.go +++ b/frankenphp.go @@ -7,7 +7,7 @@ package frankenphp //go:generate rm -Rf C-Thread-Pool/ //go:generate git clone --branch=frankenphp --depth=1 git@github.com:dunglas/C-Thread-Pool.git -//go:generate rm -Rf C-Thread-Pool/.git C-Thread-Pool/.circleci C-Thread-Pool/docs C-Thread-Pool/tests +//go:generate rm -Rf C-Thread-Pool/.git C-Thread-Pool/.circleci C-Thread-Pool/docs C-Thread-Pool/tests C-Thread-Pool/example.c // Use PHP includes corresponding to your PHP installation by running: //