Update comments

This commit is contained in:
Patrick Pelissier committed 2022-11-05 13:36:57 +01:00
1 parent 3806495e2d
commit d17fa4530b
2 files changed
+9 -6

No files matched your search

+3
View File
@@ -6943,6 +6943,9 @@ The following methods are available:
A pool of worker.
The type is incompatible between C++, C/CLANG and C(all others) due to technical constraints,
so a variable of such a type shall always be accessed by the same compiler.
#### worker\_sync\_t
A synchronization point between workers.
+6 -6
View File
@@ -40,7 +40,7 @@
#include "m-buffer.h"
#include "m-mutex.h"
/* Include needed system header for detection of how many core on the system */
/* Include needed system header for detection of how many cores are available in the system */
#if defined(_WIN32)
# include <windows.h>
#elif (defined(__APPLE__) && defined(__MACH__)) \
@@ -124,10 +124,10 @@ typedef struct m_work3r_order_s {
is not sufficient for initialization of the structure.
So let's use C++ constructor, destructor and copy constructor */
#if M_USE_WORKER_CPP_FUNCTION
# define M_WORK3R_CPP_INIT(x) (new (&(x)) m_work3r_order_ct())
# define M_WORK3R_CPP_INIT(x) (new (&(x)) m_work3r_order_ct())
# define M_WORK3R_CPP_INIT_SET(x, y) (new (&(x)) m_work3r_order_ct(y))
# define M_WORK3R_CPP_SET(x, y) ((x) = (y))
# define M_WORK3R_CPP_CLEAR(x) ((&(x))->~m_work3r_order_ct())
# define M_WORK3R_CPP_SET(x, y) ((x) = (y))
# define M_WORK3R_CPP_CLEAR(x) ((&(x))->~m_work3r_order_ct())
# define M_WORK3R_CPP_INIT_MOVE(x,y) (new (&(x)) m_work3r_order_ct(y), ((&(y))->~m_work3r_order_ct()))
# define M_WORK3R_OPLIST \
(INIT(M_WORK3R_CPP_INIT), INIT_SET(M_WORK3R_CPP_INIT_SET), \
@@ -136,7 +136,7 @@ typedef struct m_work3r_order_s {
# define M_WORK3R_OPLIST M_POD_OPLIST
#endif
/* Definition of a worker (implemented by a thread) */
/* Definition of the identity of a worker thread */
typedef struct m_work3r_thread_s {
m_thread_t id;
} m_work3r_thread_ct;
@@ -174,7 +174,7 @@ typedef struct m_worker_sync_s {
struct m_worker_s *worker; // Reference to the pool of workers
} m_worker_sync_t[1];
/* Return the number of CPU of the system */
/* Return the number of cores available in the system */
static inline int
m_work3r_get_cpu_count(void)
{