mirror of
https://github.com/Pithikos/C-Thread-Pool
synced 2024-11-22 05:31:18 +03:00
updated API
This commit is contained in:
parent
719651fd58
commit
14d0ee9e76
@ -29,17 +29,17 @@ void task2(){
|
||||
int main(){
|
||||
|
||||
puts("Making threadpool with 4 threads");
|
||||
thpool threadpool = thpool_init(4);
|
||||
threadpool thpool = thpool_init(4);
|
||||
|
||||
puts("Adding 40 tasks to threadpool");
|
||||
int i;
|
||||
for (i=0; i<20; i++){
|
||||
thpool_add_work(threadpool, (void*)task1, NULL);
|
||||
thpool_add_work(threadpool, (void*)task2, NULL);
|
||||
thpool_add_work(thpool, (void*)task1, NULL);
|
||||
thpool_add_work(thpool, (void*)task2, NULL);
|
||||
};
|
||||
|
||||
puts("Killing threadpool");
|
||||
thpool_destroy(threadpool);
|
||||
thpool_destroy(thpool);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user