Update comments

This commit is contained in:
Patrick Pelissier committed 2017-12-27 23:59:29 +01:00
1 parent 31820e7a5d
commit 66eff4eb44
1 file changed
+7 -6
+7 -6
View File
@@ -31,6 +31,7 @@
#include "m-buffer.h" #include "m-buffer.h"
#include "m-mutex.h" #include "m-mutex.h"
/* Needed header for detection of how many core on the system */
#if defined(_WIN32) #if defined(_WIN32)
# include <windows.h> # include <windows.h>
#elif (defined(__APPLE__) && defined(__MACH__)) \ #elif (defined(__APPLE__) && defined(__MACH__)) \
@@ -38,7 +39,7 @@
|| defined(__NetBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
# include <sys/param.h> # include <sys/param.h>
# include <sys/sysctl.h> # include <sys/sysctl.h>
# define USE_SYSCTL # define WORKER_USE_SYSCTL
#else #else
# include <unistd.h> # include <unistd.h>
#endif #endif
@@ -49,10 +50,10 @@
So you need to compile with "-fblocks" and link with "-lBlocksRuntime" So you need to compile with "-fblocks" and link with "-lBlocksRuntime"
if you use clang & want to use the MACRO version. if you use clang & want to use the MACRO version.
if C++, you will use Lambda function (and std::function) instead if C++, it will use Lambda function (and std::function) instead
(We don't support pre-C++11 compiler). (It doesn't support pre-C++11 compiler).
Otherwise we go for nested function for the MACRO version. Otherwise go with nested function for the MACRO version.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
# define WORKER_CPP_FUNCTION 1 # define WORKER_CPP_FUNCTION 1
@@ -102,7 +103,7 @@ typedef struct work_order_s {
# define WORKER_EXTRA_ORDER # define WORKER_EXTRA_ORDER
#endif #endif
/* This type defines a worker */ /* This type defines a worker represented as a thread */
typedef struct worker_thread_s { typedef struct worker_thread_s {
m_thread_t id; m_thread_t id;
} worker_thread_t; } worker_thread_t;
@@ -137,7 +138,7 @@ workeri_get_cpu_count(void)
SYSTEM_INFO sysinfo; SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo); GetSystemInfo(&sysinfo);
return sysinfo.dwNumberOfProcessors; return sysinfo.dwNumberOfProcessors;
#elif defined(USE_SYSCTL) #elif defined(WORKER_USE_SYSCTL)
int nm[2]; int nm[2];
int count = 0; int count = 0;
size_t len = sizeof (count); size_t len = sizeof (count);