mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-18 00:40:30 +02:00
Avoid calling select() with an error pointlessly.
It's just a spin loop unfortunately anyway.
This commit is contained in:
1 parent
0bba5310b6
commit
66d0cef0de
1 file changed
+2
-10
+2
-10
@@ -24,16 +24,6 @@
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#define NOMINMAX
|
||||
#include <winsock2.h>
|
||||
|
||||
static inline int usleep(long us) {
|
||||
struct timeval tv;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = us;
|
||||
return select(0, NULL, NULL, NULL, &tv);
|
||||
}
|
||||
#endif
|
||||
|
||||
// TODO: Move the relevant parts into common. Don't want the core
|
||||
@@ -706,7 +696,9 @@ void hleLagSync(u64 userdata, int cyclesLate) {
|
||||
time_update();
|
||||
while (time_now_d() < goal) {
|
||||
const double left = goal - time_now_d();
|
||||
#ifndef _WIN32
|
||||
usleep((long)(left * 1000000));
|
||||
#endif
|
||||
time_update();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user