diff options
Diffstat (limited to 'include/bh')
| -rw-r--r-- | include/bh/buffer.h | 1 | ||||
| -rw-r--r-- | include/bh/config.in | 4 | ||||
| -rw-r--r-- | include/bh/deflate.h | 1 | ||||
| -rw-r--r-- | include/bh/file.h | 1 | ||||
| -rw-r--r-- | include/bh/internal/bh.h | 7 | ||||
| -rw-r--r-- | include/bh/internal/buffer.h | 1 | ||||
| -rw-r--r-- | include/bh/internal/config.in | 6 | ||||
| -rw-r--r-- | include/bh/internal/file.h | 1 | ||||
| -rw-r--r-- | include/bh/internal/hashmap.h | 1 | ||||
| -rw-r--r-- | include/bh/internal/io.h | 1 | ||||
| -rw-r--r-- | include/bh/internal/queue.h | 1 | ||||
| -rw-r--r-- | include/bh/internal/thread.h | 5 | ||||
| -rw-r--r-- | include/bh/thread.h | 11 |
13 files changed, 30 insertions, 11 deletions
diff --git a/include/bh/buffer.h b/include/bh/buffer.h index 35c89cc..b3a891f 100644 --- a/include/bh/buffer.h +++ b/include/bh/buffer.h @@ -1,6 +1,7 @@ #ifndef BH_BUFFER_H #define BH_BUFFER_H +#include "bh.h" #include "io.h" typedef struct bh_buffer_s bh_buffer_t; diff --git a/include/bh/config.in b/include/bh/config.in index 5820781..87ff147 100644 --- a/include/bh/config.in +++ b/include/bh/config.in @@ -1,10 +1,8 @@ #ifndef BH_CONFIG_H #define BH_CONFIG_H -#cmakedefine BH_USE_WINTHREAD -#cmakedefine BH_USE_PTHREAD -#cmakedefine BH_NO_WINXP #cmakedefine BH_PLATFORM_POSIX #cmakedefine BH_PLATFORM_WIN +#cmakedefine BH_PLATFORM_THREADS #endif /* BH_CONFIG_H */ diff --git a/include/bh/deflate.h b/include/bh/deflate.h index 7d9eaba..08821b0 100644 --- a/include/bh/deflate.h +++ b/include/bh/deflate.h @@ -1,5 +1,6 @@ #ifndef BH_DEFLATE_H #define BH_DEFLATE_H +#include "bh.h" #endif /* BH_DEFLATE_H */ diff --git a/include/bh/file.h b/include/bh/file.h index 3410f74..8a0d3b1 100644 --- a/include/bh/file.h +++ b/include/bh/file.h @@ -1,6 +1,7 @@ #ifndef BH_FILE_H #define BH_FILE_H +#include "bh.h" #include "io.h" typedef struct bh_file_s bh_file_t; diff --git a/include/bh/internal/bh.h b/include/bh/internal/bh.h new file mode 100644 index 0000000..5738c88 --- /dev/null +++ b/include/bh/internal/bh.h @@ -0,0 +1,7 @@ +#ifndef BH_INTERNAL_H +#define BH_INTERNAL_H + +#include <bh/bh.h> +#include <bh/internal/config.h> + +#endif /* BH_INTERNAL_H */
\ No newline at end of file diff --git a/include/bh/internal/buffer.h b/include/bh/internal/buffer.h index ab033b6..4e232d8 100644 --- a/include/bh/internal/buffer.h +++ b/include/bh/internal/buffer.h @@ -1,6 +1,7 @@ #ifndef BH_INTERNAL_BUFFER_H #define BH_INTERNAL_BUFFER_H +#include "bh.h" #include <bh/buffer.h> struct bh_buffer_s diff --git a/include/bh/internal/config.in b/include/bh/internal/config.in new file mode 100644 index 0000000..5be792c --- /dev/null +++ b/include/bh/internal/config.in @@ -0,0 +1,6 @@ +#ifndef BH_INTERNAL_CONFIG_H +#define BH_INTERNAL_CONFIG_H + +#cmakedefine BH_THREADS_WINXP + +#endif /* BH_INTERNAL_CONFIG_H */
\ No newline at end of file diff --git a/include/bh/internal/file.h b/include/bh/internal/file.h index f23cf29..1e9fed0 100644 --- a/include/bh/internal/file.h +++ b/include/bh/internal/file.h @@ -1,6 +1,7 @@ #ifndef BH_INTERNAL_FILE_H #define BH_INTERNAL_FILE_H +#include "bh.h" #include "io.h" #include <bh/file.h> diff --git a/include/bh/internal/hashmap.h b/include/bh/internal/hashmap.h index 416611d..6b59393 100644 --- a/include/bh/internal/hashmap.h +++ b/include/bh/internal/hashmap.h @@ -1,6 +1,7 @@ #ifndef BH_INTERNAL_HASHMAP_H #define BH_INTERNAL_HASHMAP_H +#include "bh.h" #include <bh/hashmap.h> typedef struct bh_hashmap_node_s diff --git a/include/bh/internal/io.h b/include/bh/internal/io.h index 988982c..d0be93b 100644 --- a/include/bh/internal/io.h +++ b/include/bh/internal/io.h @@ -1,6 +1,7 @@ #ifndef BH_INTERNAL_IO_H #define BH_INTERNAL_IO_H +#include "bh.h" #include <bh/io.h> void bh_io_init(bh_io_t *io, diff --git a/include/bh/internal/queue.h b/include/bh/internal/queue.h index fd3d8e8..04a5568 100644 --- a/include/bh/internal/queue.h +++ b/include/bh/internal/queue.h @@ -1,6 +1,7 @@ #ifndef BH_INTERNAL_QUEUE_H #define BH_INTERNAL_QUEUE_H +#include "bh.h" #include <bh/queue.h> struct bh_queue_s diff --git a/include/bh/internal/thread.h b/include/bh/internal/thread.h index 8ef9487..4f3e37e 100644 --- a/include/bh/internal/thread.h +++ b/include/bh/internal/thread.h @@ -1,6 +1,7 @@ #ifndef BH_INTERNAL_THREAD_H #define BH_INTERNAL_THREAD_H +#include "bh.h" #include <bh/thread.h> #include "queue.h" @@ -8,9 +9,9 @@ #define BH_MAX_TLS 32 -#if defined(BH_USE_PTHREAD) +#if defined(BH_PLATFORM_POSIX) && defined(BH_PLATFORM_THREADS) #include "thread_posix.h" -#elif defined(BH_USE_WINTHREAD) +#elif defined(BH_PLATFORM_WIN) && defined(BH_PLATFORM_THREADS) #include "thread_win.h" #else #include "thread_null.h" diff --git a/include/bh/thread.h b/include/bh/thread.h index 598f4f7..7cc92fb 100644 --- a/include/bh/thread.h +++ b/include/bh/thread.h @@ -14,12 +14,7 @@ typedef struct bh_task_s bh_task_t; typedef struct bh_thread_pool_s bh_thread_pool_t; typedef struct bh_spinlock_s bh_spinlock_t; -#if defined(BH_USE_PTHREAD) -bh_thread_t *bh_thread_new(bh_task_t *task); - -bh_thread_pool_t *bh_thread_pool_new(size_t size); - -#elif defined(BH_USE_WINTHREAD) +#if defined(BH_PLATFORM_WIN) && defined(BH_PLATFORM_THREADS) #include <windows.h> #include <process.h> @@ -46,6 +41,10 @@ bh_thread_pool_t *bh_thread_pool_new_base(size_t size, #define bh_thread_pool_new(size) \ bh_thread_pool_new_base((size), _beginthreadex, _endthreadex); +#elif defined(BH_PLATFORM_THREADS) +bh_thread_t *bh_thread_new(bh_task_t *task); + +bh_thread_pool_t *bh_thread_pool_new(size_t size); #endif bh_task_t *bh_task_new(void (*func)(void *), |
