Memore leaks solved

This commit is contained in:
pithikos 2015-01-09 17:35:26 +00:00
parent c91ab00300
commit 3a844f4dfb
2 changed files with 17 additions and 5 deletions

View File

@ -247,7 +247,8 @@ static void* thread_do(thread_t* thread){
thpool->threads_alive --;
pthread_mutex_unlock(&thpool->thcount_lock);
printf("Thread %d exiting\n", (*thread).id);
pthread_exit(NULL);
//pthread_exit(NULL);
return NULL;
}

View File

@ -52,6 +52,7 @@
* |___________| | |..
*
*
*
*/
@ -211,12 +212,11 @@ void thpool_destroy(thpool_t* thpool);
* Notice also that the thread's id is not populated automatically.
*
* @param threadpool threadpool to create thread
* @param thread pointer to the thread that will be created
* @param thread address to the pointer of the thread to be created
* @param id id to be given to thread
*
* @return the initialized thread
*/
thread_t* thread_init(thpool_t* thpool, thread_t* thread, int id);
void thread_init(thpool_t* thpool, thread_t** thread, int id);
/**
@ -239,6 +239,16 @@ static void* thread_do(thread_t* thread);
static void thread_hold();
/**
* @brief Frees a thread
* @param thread
* @return nothing
*/
static void thread_destroy(thread_t* thread);
/* ----------------------- Queue specific --------------------------- */
@ -306,7 +316,8 @@ static void jobqueue_destroy(thpool_t* thpool);
/* ======================== SYNCHRONISATION ========================= */
/* ----------------------- Synchronisation -------------------------- */
/**
* @brief Inits semaphore to given value