#include "thread_pool.h"
+#include "job_queue.h"
+
#include <stdlib.h>
#include <freeswan.h>
#include <pluto/constants.h>
#include <pthread.h>
+extern job_queue_t *job_queue;
+
+
/**
* structure with private members for thread_pool
*/
} private_thread_pool_t;
+pthread_mutex_t muti = PTHREAD_MUTEX_INITIALIZER;
+pthread_cond_t condi = PTHREAD_COND_INITIALIZER;
void *job_processing(private_thread_pool_t *this)
{
+
for (;;) {
- sleep(1);
+ /*job_t *job;
+ job_queue->get(job_queue, &job);*/
+ sleep(100);
/* flag for termination received ? */
pthread_testcancel();
}
static status_t destroy(private_thread_pool_t *this)
{
int current;
-
+
/* flag thread for termination */
for (current = 0; current < this->pool_size; current++) {
pthread_cancel(this->threads[current]);