Source/Backend/thread_pool/gtr_thread_pool.c
int thread_pool_add_work(thread_pool thread_pool_p, void (*function_p)(void *), void *arg_p) {
    job *new_job = (job *) malloc(sizeof(job));

    if (new_job == NULL) {
        err("thread_pool_add_work(): Could not allocate memory for new job\n");
        return -1;
    }

    /* add function and argument */
    new_job->function = function_p;
    new_job->arg = arg_p;

    /* add job to queue */
    job_queue_push(&thread_pool_p->job_queue, new_job);

    return 0;
}
/* Add work to the thread pool */
Add work to the thread pool
Add work to the thread pool
int thread_pool_add_work(thread_pool thread_pool_p, void (*function_p)(void *), void *arg_p) {
    job *new_job = (job *) malloc(sizeof(job));
    if (new_job == NULL) {
        err("thread_pool_add_work(): Could not allocate memory for new job\n");
        return -1;
    }
    new_job->function = function_p;
    new_job->arg = arg_p;
    job_queue_push(&thread_pool_p->job_queue, new_job);
    return 0;
}
int thread_pool_add_work ( thread_pool thread_pool_p , void ( * function_p ) ( void * ) , void * arg_p ) { job * new_job = ( job * ) malloc ( sizeof ( job ) ) ; if ( new_job == NULL ) { err ( " \n " ) ; return -1 ; } new_job -> function = function_p ; new_job -> arg = arg_p ; job_queue_push ( & thread_pool_p -> job_queue , new_job ) ; return 0 ; }
Add work to the thread pool
Add work to the thread pool
/* add function and argument */ /* add job to queue */