mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
need more than 1 usec sleep to be effective.
This commit is contained in:
parent
89dc1bcb5c
commit
0eb47e3811
@ -666,10 +666,10 @@ subprocess_run() {
|
|||||||
FD_ZERO(&fds);
|
FD_ZERO(&fds);
|
||||||
FD_SET(read_fd, &fds);
|
FD_SET(read_fd, &fds);
|
||||||
|
|
||||||
|
// Sleep a bit to yield the timeslice if there's nothing new.
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = 1; // Sleep a bit to yield the timeslice if there's
|
tv.tv_usec = 1000; // 1 usec is not enough.
|
||||||
// nothing new.
|
|
||||||
|
|
||||||
int result = select(read_fd + 1, &fds, NULL, NULL, &tv);
|
int result = select(read_fd + 1, &fds, NULL, NULL, &tv);
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user