Source/Backend/thread_pool/gtr_thread_pool.c
static int thread_init(gtr_thread_pool *thread_pool_p, thread **thread_p, int id) {

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

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

    pthread_create(&(*thread_p)->pthread, NULL, (void *) thread_do, (*thread_p));
    pthread_detach((*thread_p)->pthread);
    return 0;
}
/* Initialize a thread in the thread pool
 *
 * @param thread        address to the pointer of the thread to be created
 * @param id            id to be given to the thread
 * @return 0 on success, -1 otherwise.
 */
Initialize a thread in the thread pool
@param thread        address to the pointer of the thread to be created
@param id            id to be given to the thread
@return 0 on success, -1 otherwise.
Initialize a thread in the thread pool @param thread address to the pointer of the thread to be created @param id id to be given to the thread @return 0 on success - 1 otherwise .
static int thread_init(gtr_thread_pool *thread_pool_p, thread **thread_p, int id) {
    *thread_p = (thread *) malloc(sizeof(thread));
    if (*thread_p == NULL) {
        err("thread_init(): Could not allocate memory for thread\n");
        return -1;
    }
    (*thread_p)->thread_pool_p = thread_pool_p;
    (*thread_p)->id = id;
    pthread_create(&(*thread_p)->pthread, NULL, (void *) thread_do, (*thread_p));
    pthread_detach((*thread_p)->pthread);
    return 0;
}
static int thread_init ( gtr_thread_pool * thread_pool_p , thread * * thread_p , int id ) { * thread_p = ( thread * ) malloc ( sizeof ( thread ) ) ; if ( * thread_p == NULL ) { err ( " \n " ) ; return -1 ; } ( * thread_p ) -> thread_pool_p = thread_pool_p ; ( * thread_p ) -> id = id ; pthread_create ( & ( * thread_p ) -> pthread , NULL , ( void * ) thread_do , ( * thread_p ) ) ; pthread_detach ( ( * thread_p ) -> pthread ) ; return 0 ; }
Initialize a thread in the thread pool
 @param thread        address to the pointer of the thread to be created
 @param id            id to be given to the thread
 @return 0 on success, -1 otherwise.
Initialize a thread in the thread pool @param thread address to the pointer of the thread to be created @param id id to be given to the thread @return 0 on success - 1 otherwise .