diff options
author | Marat Dukhan <maratek@google.com> | 2020-04-10 04:56:26 -0700 |
---|---|---|
committer | Marat Dukhan <maratek@google.com> | 2020-04-10 04:56:26 -0700 |
commit | 7e8364c2883dc2694d29ac66353c78cf4df0d343 (patch) | |
tree | 68b5a9432c87fe06abd4684338dc667c6b9c7962 /src/shim.c | |
parent | 02b50e65341cc8ded117c4d42ff6d11f8e838cf1 (diff) | |
download | pthreadpool-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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; } |