mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
Update vm.h
This commit is contained in:
parent
ffd6915de7
commit
9909e16649
8
src/vm.h
8
src/vm.h
@ -1117,11 +1117,7 @@ public:
|
|||||||
void suspend(){
|
void suspend(){
|
||||||
if(_state != THREAD_RUNNING) UNREACHABLE();
|
if(_state != THREAD_RUNNING) UNREACHABLE();
|
||||||
_state = THREAD_SUSPENDED;
|
_state = THREAD_SUSPENDED;
|
||||||
// 50 fps is enough
|
while(_state == THREAD_SUSPENDED) _checkStopFlag();
|
||||||
while(_state == THREAD_SUSPENDED){
|
|
||||||
_checkStopFlag();
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_Str readJsonRpcRequest(){
|
_Str readJsonRpcRequest(){
|
||||||
@ -1138,8 +1134,8 @@ public:
|
|||||||
|
|
||||||
void writeJsonrpcResponse(const char* value){
|
void writeJsonrpcResponse(const char* value){
|
||||||
if(_state != THREAD_SUSPENDED) UNREACHABLE();
|
if(_state != THREAD_SUSPENDED) UNREACHABLE();
|
||||||
_state = THREAD_RUNNING;
|
|
||||||
_sharedStr = _Str(value);
|
_sharedStr = _Str(value);
|
||||||
|
_state = THREAD_RUNNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
void execAsync(const _Code& code) override {
|
void execAsync(const _Code& code) override {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user