aboutsummaryrefslogtreecommitdiff
path: root/src/shim.c
diff options
context:
space:
mode:
authorMarat Dukhan <maratek@google.com>2020-04-10 04:56:26 -0700
committerMarat Dukhan <maratek@google.com>2020-04-10 04:56:26 -0700
commit7e8364c2883dc2694d29ac66353c78cf4df0d343 (patch)
tree68b5a9432c87fe06abd4684338dc667c6b9c7962 /src/shim.c
parent02b50e65341cc8ded117c4d42ff6d11f8e838cf1 (diff)
downloadpthreadpool-7e8364c2883dc2694d29ac66353c78cf4df0d343.tar.gz
Return static thread pool pointer in shim implementation
Makes pthreadpool tests pass in WebAssembly builds
Diffstat (limited to 'src/shim.c')
-rw-r--r--src/shim.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shim.c b/src/shim.c
index b376a7a..7bf378c 100644
--- a/src/shim.c
+++ b/src/shim.c
@@ -8,7 +8,17 @@
#include "threadpool-utils.h"
+struct pthreadpool {
+};
+
+static const struct pthreadpool static_pthreadpool = { };
+
+
struct pthreadpool* pthreadpool_create(size_t threads_count) {
+ if (threads_count <= 1) {
+ return (struct pthreadpool*) &static_pthreadpool;
+ }
+
return NULL;
}