mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-01-11 19:28:40 +00:00
31 lines
534 B
C++
Executable File
31 lines
534 B
C++
Executable File
#ifndef THREADS_THREAD_POOL_H
|
|
#define THREADS_THREAD_POOL_H
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
#ifdef _WIN32
|
|
#include <windows.h>
|
|
#else
|
|
#include <unistd.h>
|
|
#include <pthread.h>
|
|
#endif
|
|
|
|
#include "OSWrapper.h"
|
|
#include "Job.h"
|
|
|
|
namespace Threads
|
|
{
|
|
struct ThreadPool {
|
|
Job *work_first;
|
|
Job *work_last;
|
|
pthread_mutex_t work_mutex;
|
|
pthread_cond_t work_cond;
|
|
pthread_cond_t working_cond;
|
|
size_t working_cnt;
|
|
size_t thread_cnt;
|
|
bool stop;
|
|
};
|
|
}
|
|
|
|
#endif |