mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-24 04:46:05 +08:00
Revert "fix a bug which simulator use high CPU usage if app cannot respond"
This change made normal usage of the REPL when trying to select a view
very slow. Needs a better fix after the 2.25 release.
This reverts commit 5b1398c796.
Related to http://hipbyte.myjetbrains.com/youtrack/issue/RM-458.
This commit is contained in:
12
bin/sim.m
12
bin/sim.m
@@ -712,18 +712,6 @@ receive_string(void)
|
||||
NSMutableString *res = [NSMutableString new];
|
||||
bool received_something = false;
|
||||
while (true) {
|
||||
fd_set read_fds;
|
||||
FD_ZERO(&read_fds);
|
||||
FD_SET(repl_fd, &read_fds);
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 50000;
|
||||
if (select(repl_fd + 1, &read_fds, NULL, NULL, &tv) == -1) {
|
||||
perror("select()");
|
||||
break;
|
||||
}
|
||||
|
||||
char buf[1024 + 1];
|
||||
ssize_t len = recv(repl_fd, buf, sizeof buf, 0);
|
||||
if (len == -1) {
|
||||
|
||||
Reference in New Issue
Block a user