| 801 | { |
| 802 | QiFunc_sleep() : QiFunc(1) {} |
| 803 | QiVar exec(const std::vector<QiVar>& args, QiScriptInterpreter* inter) const override |
| 804 | { |
| 805 | long long ms = args[0].toInteger(); |
| 806 | inter->thisMutex()->lock(); |
| 807 | QiWorker* worker = inter->worker(); |
| 808 | worker ? worker->sleep(ms) : Sleep(ms); |
| 809 | inter->thisMutex()->unlock(); |
| 810 | return {}; |
| 811 | } |
| 812 | }; |
| 813 | struct QiFunc_exit : public QiFunc |
| 814 | { |