chromium/third_party/unrar/src/threadpool.hpp

#ifndef _RAR_THREADPOOL_
#define _RAR_THREADPOOL_

#ifndef RAR_SMP
const uint MaxPoolThreads=1; // For single threaded version.
#else
// We need to use the processor groups API to increase it beyond 64.
// Also be sure to check and adjust if needed per thread and total block size
// when compressing if going above 64.
const uint MaxPoolThreads=;


#ifdef _UNIX
  #include <pthread.h>
  #include <semaphore.h>
#endif

// Undefine for debugging.
#define USE_THREADS

#ifdef _UNIX
  #define NATIVE_THREAD_TYPE
  NATIVE_THREAD_PTR;
  THREAD_HANDLE;
  CRITSECT_HANDLE;
#else
  #define NATIVE_THREAD_TYPE
  typedef DWORD (WINAPI *NATIVE_THREAD_PTR)(void *Data);
  typedef HANDLE THREAD_HANDLE;
  typedef CRITICAL_SECTION CRITSECT_HANDLE;
#endif

PTHREAD_PROC;
#define THREAD_PROC(fn)

uint GetNumberOfCPU();
uint GetNumberOfThreads();


class ThreadPool
{};

#endif // RAR_SMP

#endif // _RAR_THREADPOOL_