Rename m-mutex header into m-thread

as it is not just about mutex but about thread functions
just like the header pthread or thread.h
This commit is contained in:
Patrick Pelissier committed 2023-02-16 00:09:06 +01:00
1 parent 56f51c59af
commit 91f3174a36
15 files changed
+16 -16

No files matched your search

+1 -1
View File
@@ -37,7 +37,7 @@ PACKAGE=m_lib-$(VERSION)
VERSION=0.7.1 VERSION=0.7.1
# Define the contain of the distribution tarball # Define the contain of the distribution tarball
HEADER=m-algo.h m-array.h m-atomic.h m-bitset.h m-bptree.h m-buffer.h m-c-mempool.h m-concurrent.h m-core.h m-deque.h m-dict.h m-funcobj.h m-genint.h m-i-list.h m-i-shared.h m-list.h m-mempool.h m-mutex.h m-prioqueue.h m-rbtree.h m-serial-bin.h m-serial-json.h m-shared.h m-snapshot.h m-string.h m-tree.h m-tuple.h m-variant.h m-worker.h HEADER=m-algo.h m-array.h m-atomic.h m-bitset.h m-bptree.h m-buffer.h m-c-mempool.h m-concurrent.h m-core.h m-deque.h m-dict.h m-funcobj.h m-genint.h m-i-list.h m-i-shared.h m-list.h m-mempool.h m-thread.h m-mutex.h m-prioqueue.h m-rbtree.h m-serial-bin.h m-serial-json.h m-shared.h m-snapshot.h m-string.h m-tree.h m-tuple.h m-variant.h m-worker.h
DOC1=LICENSE README.md DOC1=LICENSE README.md
DOC2=doc/API.txt doc/Container.html doc/Container.ods doc/depend.png doc/DEV.md doc/ISSUES.org doc/oplist.odp doc/oplist.png DOC2=doc/API.txt doc/Container.html doc/Container.ods doc/depend.png doc/DEV.md doc/ISSUES.org doc/oplist.odp doc/oplist.png
EXAMPLE=example/ex11-algo01.c example/ex11-algo02.c example/ex11-json01.c example/ex11-section.c example/ex-algo02.c example/ex-algo03.c example/ex-algo04.c example/ex-array00.c example/ex-array01.c example/ex-array02.c example/ex-array03.c example/ex-array04.c example/ex-array05.c example/ex-bptree01.c example/ex-buffer01.c example/ex-dict01.c example/ex-dict02.c example/ex-dict03.c example/ex-dict04.c example/ex-grep01.c example/ex-list01.c example/ex-mph.c example/ex-multi01.c example/ex11-multi02.c example/ex-multi03.c example/ex-multi04.c example/ex-multi05.c example/ex-rbtree01.c example/ex11-algo02.json example/ex11-json01.json example/Makefile example/ex-defer01.c example/ex-string01.c example/ex-string02.c example/ex-astar.c example/ex-string03.c example/ex11-tstc.c example/ex-no-stdio.c example/ex11-count-lines.c example/ex11-json-net.c example/ex11-rbtree02.c EXAMPLE=example/ex11-algo01.c example/ex11-algo02.c example/ex11-json01.c example/ex11-section.c example/ex-algo02.c example/ex-algo03.c example/ex-algo04.c example/ex-array00.c example/ex-array01.c example/ex-array02.c example/ex-array03.c example/ex-array04.c example/ex-array05.c example/ex-bptree01.c example/ex-buffer01.c example/ex-dict01.c example/ex-dict02.c example/ex-dict03.c example/ex-dict04.c example/ex-grep01.c example/ex-list01.c example/ex-mph.c example/ex-multi01.c example/ex11-multi02.c example/ex-multi03.c example/ex-multi04.c example/ex-multi05.c example/ex-rbtree01.c example/ex11-algo02.json example/ex11-json01.json example/Makefile example/ex-defer01.c example/ex-string01.c example/ex-string02.c example/ex-astar.c example/ex-string03.c example/ex11-tstc.c example/ex-no-stdio.c example/ex11-count-lines.c example/ex11-json-net.c example/ex11-rbtree02.c
+3 -3
View File
@@ -135,7 +135,7 @@ Other headers offering other functionality are:
Finally headers for compatibility with non C11 compilers: Finally headers for compatibility with non C11 compilers:
* [m-atomic.h](#m-atomic): header for ensuring compatibility between C's stdatomic.h and C++'s atomic header. Provide also an implementation over mutex if nothing is available. * [m-atomic.h](#m-atomic): header for ensuring compatibility between C's stdatomic.h and C++'s atomic header. Provide also an implementation over mutex if nothing is available.
* [m-mutex.h](#m-mutex): header for providing a very thin layer across multiple implementation of mutex/threads (C11/PTHREAD/WIN32). * [m-thread.h](#m-thread): header for providing a very thin layer across multiple implementation of mutex/threads (C11/PTHREAD/WIN32).
Each containers define their iterators. Each containers define their iterators.
@@ -6796,7 +6796,7 @@ The full C definition are:
See [m-serial-json.h](#m-serial-json) for example of use. See [m-serial-json.h](#m-serial-json) for example of use.
### M-MUTEX ### M-THREAD
This header is for providing very thin layer around OS implementation of threads, conditional variables and mutex. This header is for providing very thin layer around OS implementation of threads, conditional variables and mutex.
It has back-ends for WIN32, POSIX thread or C11 thread. It has back-ends for WIN32, POSIX thread or C11 thread.
@@ -7869,7 +7869,7 @@ Default value: 128
### M\_USE\_THREAD\_BACKEND ### M\_USE\_THREAD\_BACKEND
Define the thread backend to use by m-mutex.h: Define the thread backend to use by m-thread.h:
* 1: for C11 header threads.h * 1: for C11 header threads.h
* 2: for WINDOWS header windows.h * 2: for WINDOWS header windows.h
+1 -1
View File
@@ -14,7 +14,7 @@
#include "m-mempool.h" #include "m-mempool.h"
#include "m-string.h" #include "m-string.h"
#include "m-buffer.h" #include "m-buffer.h"
#include "m-mutex.h" #include "m-thread.h"
#include "m-deque.h" #include "m-deque.h"
#include "m-concurrent.h" #include "m-concurrent.h"
#include "m-tuple.h" #include "m-tuple.h"
+1 -1
View File
@@ -31,7 +31,7 @@
// Needed for M_THREAD_ATTR // Needed for M_THREAD_ATTR
#if defined(MULTI_THREAD_MEASURE) #if defined(MULTI_THREAD_MEASURE)
#include "m-mutex.h" #include "m-thread.h"
#endif #endif
#if defined(_WIN32) #if defined(_WIN32)
+1 -1
View File
@@ -2,7 +2,7 @@
#include "m-buffer.h" #include "m-buffer.h"
#include "m-shared.h" #include "m-shared.h"
#include "m-mutex.h" #include "m-thread.h"
/* Global variable to stop scheduling */ /* Global variable to stop scheduling */
atomic_bool continue_threading_g; atomic_bool continue_threading_g;
+1 -1
View File
@@ -154,7 +154,7 @@ using std::memory_order_seq_cst;
*/ */
#else #else
#include "m-mutex.h" #include "m-thread.h"
#include "m-core.h" #include "m-core.h"
M_BEGIN_PROTECTED_CODE M_BEGIN_PROTECTED_CODE
+1 -1
View File
@@ -26,7 +26,7 @@
#define MSTARLIB_BUFFER_H #define MSTARLIB_BUFFER_H
#include "m-core.h" #include "m-core.h"
#include "m-mutex.h" #include "m-thread.h"
#include "m-atomic.h" #include "m-atomic.h"
/* Define the different kind of policy a lock-based buffer can have: /* Define the different kind of policy a lock-based buffer can have:
+1 -1
View File
@@ -26,7 +26,7 @@
#define MSTARLIB_CONCURRENT_H #define MSTARLIB_CONCURRENT_H
#include "m-core.h" #include "m-core.h"
#include "m-mutex.h" #include "m-thread.h"
#include "m-atomic.h" #include "m-atomic.h"
/* Define a protected concurrent container and its associated functions /* Define a protected concurrent container and its associated functions
View File
File renamed without changes.
+1 -1
View File
@@ -38,7 +38,7 @@
#include "m-atomic.h" #include "m-atomic.h"
#include "m-buffer.h" #include "m-buffer.h"
#include "m-mutex.h" #include "m-thread.h"
/* Include needed system header for detection of how many cores are available in the system */ /* Include needed system header for detection of how many cores are available in the system */
#if defined(_WIN32) #if defined(_WIN32)
+1 -1
View File
@@ -24,7 +24,7 @@
*/ */
#include "m-c-mempool.h" #include "m-c-mempool.h"
#include "m-mutex.h" #include "m-thread.h"
C_MEMPOOL_DEF(lf_mempool, int) C_MEMPOOL_DEF(lf_mempool, int)
+1 -1
View File
@@ -21,7 +21,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include <stdio.h> #include <stdio.h>
#include "m-mutex.h" #include "m-thread.h"
#include "m-atomic.h" #include "m-atomic.h"
#include "m-genint.h" #include "m-genint.h"
+1 -1
View File
@@ -25,7 +25,7 @@
#include "m-i-shared.h" #include "m-i-shared.h"
#include "m-mutex.h" #include "m-thread.h"
#include "coverage.h" #include "coverage.h"
typedef struct ishared_s { typedef struct ishared_s {
+1 -1
View File
@@ -22,7 +22,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include "m-mutex.h" #include "m-thread.h"
M_LOCK_DECL(global_lock); M_LOCK_DECL(global_lock);
unsigned long long n = 0; unsigned long long n = 0;
+1 -1
View File
@@ -23,7 +23,7 @@
#include "test-obj.h" #include "test-obj.h"
#include "m-snapshot.h" #include "m-snapshot.h"
#include "m-mutex.h" #include "m-thread.h"
#include "coverage.h" #include "coverage.h"