diff --git a/Makefile b/Makefile index 7f0e62a5..7d2fd4f0 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ PACKAGE=m_lib-$(VERSION) VERSION=0.7.1 # 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 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 diff --git a/README.md b/README.md index 81f80ad4..fa5b1385 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ Other headers offering other functionality are: 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-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. @@ -6796,7 +6796,7 @@ The full C definition are: 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. It has back-ends for WIN32, POSIX thread or C11 thread. @@ -7869,7 +7869,7 @@ Default value: 128 ### 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 * 2: for WINDOWS header windows.h diff --git a/bench/bench-mlib.c b/bench/bench-mlib.c index f5afb8ce..0947a382 100644 --- a/bench/bench-mlib.c +++ b/bench/bench-mlib.c @@ -14,7 +14,7 @@ #include "m-mempool.h" #include "m-string.h" #include "m-buffer.h" -#include "m-mutex.h" +#include "m-thread.h" #include "m-deque.h" #include "m-concurrent.h" #include "m-tuple.h" diff --git a/bench/common.h b/bench/common.h index fb7c3a6b..6895ed18 100644 --- a/bench/common.h +++ b/bench/common.h @@ -31,7 +31,7 @@ // Needed for M_THREAD_ATTR #if defined(MULTI_THREAD_MEASURE) -#include "m-mutex.h" +#include "m-thread.h" #endif #if defined(_WIN32) diff --git a/example/ex-buffer01.c b/example/ex-buffer01.c index c9734b91..685f8093 100644 --- a/example/ex-buffer01.c +++ b/example/ex-buffer01.c @@ -2,7 +2,7 @@ #include "m-buffer.h" #include "m-shared.h" -#include "m-mutex.h" +#include "m-thread.h" /* Global variable to stop scheduling */ atomic_bool continue_threading_g; diff --git a/m-atomic.h b/m-atomic.h index ef5637ee..43f4152d 100644 --- a/m-atomic.h +++ b/m-atomic.h @@ -154,7 +154,7 @@ using std::memory_order_seq_cst; */ #else -#include "m-mutex.h" +#include "m-thread.h" #include "m-core.h" M_BEGIN_PROTECTED_CODE diff --git a/m-buffer.h b/m-buffer.h index 23d47feb..9c074e81 100644 --- a/m-buffer.h +++ b/m-buffer.h @@ -26,7 +26,7 @@ #define MSTARLIB_BUFFER_H #include "m-core.h" -#include "m-mutex.h" +#include "m-thread.h" #include "m-atomic.h" /* Define the different kind of policy a lock-based buffer can have: diff --git a/m-concurrent.h b/m-concurrent.h index 4b3fb3d8..c00274bf 100644 --- a/m-concurrent.h +++ b/m-concurrent.h @@ -26,7 +26,7 @@ #define MSTARLIB_CONCURRENT_H #include "m-core.h" -#include "m-mutex.h" +#include "m-thread.h" #include "m-atomic.h" /* Define a protected concurrent container and its associated functions diff --git a/m-mutex.h b/m-thread.h similarity index 100% rename from m-mutex.h rename to m-thread.h diff --git a/m-worker.h b/m-worker.h index a58ab7a4..5fe4066d 100644 --- a/m-worker.h +++ b/m-worker.h @@ -38,7 +38,7 @@ #include "m-atomic.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 */ #if defined(_WIN32) diff --git a/tests/test-mcmempool.c b/tests/test-mcmempool.c index c2b9647e..88e4de89 100644 --- a/tests/test-mcmempool.c +++ b/tests/test-mcmempool.c @@ -24,7 +24,7 @@ */ #include "m-c-mempool.h" -#include "m-mutex.h" +#include "m-thread.h" C_MEMPOOL_DEF(lf_mempool, int) diff --git a/tests/test-mgenint.c b/tests/test-mgenint.c index a0443ca3..dca895f6 100644 --- a/tests/test-mgenint.c +++ b/tests/test-mgenint.c @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -#include "m-mutex.h" +#include "m-thread.h" #include "m-atomic.h" #include "m-genint.h" diff --git a/tests/test-mishared.c b/tests/test-mishared.c index 743cdc01..712e66ab 100644 --- a/tests/test-mishared.c +++ b/tests/test-mishared.c @@ -25,7 +25,7 @@ #include "m-i-shared.h" -#include "m-mutex.h" +#include "m-thread.h" #include "coverage.h" typedef struct ishared_s { diff --git a/tests/test-mmutex.c b/tests/test-mmutex.c index e1fcb106..4e5933b9 100644 --- a/tests/test-mmutex.c +++ b/tests/test-mmutex.c @@ -22,7 +22,7 @@ */ #include -#include "m-mutex.h" +#include "m-thread.h" M_LOCK_DECL(global_lock); unsigned long long n = 0; diff --git a/tests/test-msnapshot.c b/tests/test-msnapshot.c index 50fb7e92..edbc8722 100644 --- a/tests/test-msnapshot.c +++ b/tests/test-msnapshot.c @@ -23,7 +23,7 @@ #include "test-obj.h" #include "m-snapshot.h" -#include "m-mutex.h" +#include "m-thread.h" #include "coverage.h"