This commit is contained in:
Бранимир Караџић
2022-08-08 20:01:07 -07:00
parent cfb6a1c1e0
commit 91fb6f84cd
3 changed files with 15 additions and 7 deletions

View File

@@ -941,7 +941,7 @@ function toolchain(_buildDir, _libDir)
}
linkoptions {
"-s MAX_WEBGL_VERSION=2"
"-s MAX_WEBGL_VERSION=2",
}
configuration { "wasm2js" }
@@ -949,7 +949,7 @@ function toolchain(_buildDir, _libDir)
objdir (path.join(_buildDir, "wasm2js/obj"))
libdirs { path.join(_libDir, "lib/wasm2js") }
linkoptions {
"-s WASM=0"
"-s WASM=0",
}
configuration { "wasm" }

View File

@@ -14,15 +14,19 @@ TEST_CASE("getProcessMemoryUsed", "")
// DBG("bx::getProcessMemoryUsed %d", bx::getProcessMemoryUsed() );
}
#if BX_CONFIG_SUPPORTS_THREADING
TEST_CASE("semaphore_timeout", "")
{
bx::Semaphore sem;
int64_t start = bx::getHPCounter();
bool ok = sem.wait(900);
int64_t elapsed = bx::getHPCounter() - start;
int64_t start = bx::getHPCounter();
bool ok = sem.wait(900);
int64_t elapsed = bx::getHPCounter() - start;
int64_t frequency = bx::getHPFrequency();
double ms = double(elapsed) / double(frequency) * 1000;
printf("%f\n", ms);
double ms = double(elapsed) / double(frequency) * 1000;
bx::printf("%f\n", ms);
REQUIRE(!ok);
}
#endif // BX_CONFIG_SUPPORTS_THREADING

View File

@@ -6,6 +6,8 @@
#include "test.h"
#include <bx/thread.h>
#if BX_CONFIG_SUPPORTS_THREADING
bx::DefaultAllocator s_allocator;
bx::MpScUnboundedBlockingQueue<void> s_mpsc(&s_allocator);
@@ -69,3 +71,5 @@ TEST_CASE("MpScUnboundedBlockingQueue", "")
REQUIRE(result == 0x1389);
}
#endif // BX_CONFIG_SUPPORTS_THREADING