add EMSCRIPTEN guards around thread waiting ResourceBuffer
This commit is contained in:
@@ -4,9 +4,11 @@
|
|||||||
#include "ResourceBuffer.h"
|
#include "ResourceBuffer.h"
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
#ifndef __EMSCRIPTEN__
|
||||||
#include <thread>
|
#include <thread>
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace flutter_filament
|
namespace flutter_filament
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -39,7 +41,9 @@ namespace flutter_filament
|
|||||||
loadToOut(uri, &rb);
|
loadToOut(uri, &rb);
|
||||||
while (rb.size == 0)
|
while (rb.size == 0)
|
||||||
{
|
{
|
||||||
|
#if! __EMSCRIPTEN__
|
||||||
std::this_thread::sleep_for(100ms);
|
std::this_thread::sleep_for(100ms);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return rb;
|
return rb;
|
||||||
|
|||||||
Reference in New Issue
Block a user