Skip to content

Commit

Permalink
emscripten processor count (#3667)
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefchutka authored Oct 23, 2023
1 parent 859a08c commit b3feec2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions codec/common/src/WelsThreadLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
#include <sys/types.h>
#include <sys/param.h>
#include <unistd.h>
#ifndef __Fuchsia__
#ifdef __EMSCRIPTEN__
#include <emscripten/threading.h>
#elif !defined(__Fuchsia__)
#include <sys/sysctl.h>
#endif
#ifdef __APPLE__
Expand Down Expand Up @@ -508,7 +510,7 @@ WELS_THREAD_ERROR_CODE WelsQueryLogicalProcessInfo (WelsLogicalProcessInfo* p
#elif defined(__EMSCRIPTEN__)

// There is not yet a way to determine CPU count in emscripten JS environment.
pInfo->ProcessorCount = 1;
pInfo->ProcessorCount = emscripten_num_logical_cores();
return WELS_THREAD_ERROR_OK;

#elif defined(__Fuchsia__)
Expand Down

0 comments on commit b3feec2

Please sign in to comment.