Skip to content

Commit

Permalink
dep: update C-Thread-Pool to ver 25fa679 (2020-07)
Browse files Browse the repository at this point in the history
  • Loading branch information
nil0x42 committed Sep 8, 2020
1 parent 38778dd commit a316b04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/thpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ typedef struct thpool_* threadpool;
/**
* @brief Initialize threadpool
*
* Initializes a threadpool. This function will not return untill all
* Initializes a threadpool. This function will not return until all
* threads have initialized successfully.
*
* @example
Expand Down Expand Up @@ -77,7 +77,7 @@ int thpool_add_work(threadpool, void (*function_p)(void*), void* arg_p);
* Smart polling is used in wait. The polling is initially 0 - meaning that
* there is virtually no polling at all. If after 1 seconds the threads
* haven't finished, the polling interval starts growing exponentially
* untill it reaches max_secs seconds. Then it jumps down to a maximum polling
* until it reaches max_secs seconds. Then it jumps down to a maximum polling
* interval assuming that heavy processing is being used in the threadpool.
*
* @example
Expand Down
8 changes: 2 additions & 6 deletions src/thpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,15 @@ int thpool_num_threads_working(thpool_* thpool_p){
static int thread_init (thpool_* thpool_p, struct thread** thread_p, int id){

*thread_p = (struct thread*)malloc(sizeof(struct thread));
if (thread_p == NULL){
if (*thread_p == NULL){
err("thread_init(): Could not allocate memory for thread\n");
return -1;
}

(*thread_p)->thpool_p = thpool_p;
(*thread_p)->id = id;

pthread_create(&(*thread_p)->pthread, NULL, (void *)thread_do, (*thread_p));
pthread_create(&(*thread_p)->pthread, NULL, (void * (*)(void *)) thread_do, (*thread_p));
pthread_detach((*thread_p)->pthread);
return 0;
}
Expand Down Expand Up @@ -456,11 +456,7 @@ static void jobqueue_push(jobqueue* jobqueue_p, struct job* newjob){


/* Get first job from queue(removes it from queue)
<<<<<<< HEAD
*
* Notice: Caller MUST hold a mutex
=======
>>>>>>> da2c0fe45e43ce0937f272c8cd2704bdc0afb490
*/
static struct job* jobqueue_pull(jobqueue* jobqueue_p){

Expand Down

0 comments on commit a316b04

Please sign in to comment.