about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-07-13 20:52:35 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-07-13 20:52:35 -0400
commit07774bfa274462a74da04222712d5d096b1d14cb (patch)
tree5a29243ab611cc7150340f6b2f8a812b85660b2e
parent2190722ac1f0732cf35e7b63572afa698a47789d (diff)
downloadgen3uploader-07774bfa274462a74da04222712d5d096b1d14cb.tar.gz
gen3uploader-07774bfa274462a74da04222712d5d096b1d14cb.tar.bz2
gen3uploader-07774bfa274462a74da04222712d5d096b1d14cb.zip
Removed a lot of sleeps that turned out to be unnecessary
It's faster now, yay!
-rw-r--r--source/link.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/link.c b/source/link.c index 1091576..f63f4a5 100644 --- a/source/link.c +++ b/source/link.c
@@ -86,11 +86,10 @@ u32 getMsg()
86 while (val == 0) 86 while (val == 0)
87 { 87 {
88 val = __builtin_bswap32(recv()); 88 val = __builtin_bswap32(recv());
89 sleep(1);
90 } 89 }
91 90
92 send(0); 91 send(0);
93 while (recv()!=0) {sleep(1);} 92 while (recv()!=0);
94 send(0); 93 send(0);
95 94
96 return val; 95 return val;
@@ -101,15 +100,14 @@ void getMsgArr(u32* arr, int len)
101 for (int i=0; i<len; i++) 100 for (int i=0; i<len; i++)
102 { 101 {
103 *(vu32*)(arr+i) = __builtin_bswap32(recv()); 102 *(vu32*)(arr+i) = __builtin_bswap32(recv());
104 usleep(500000);
105 } 103 }
106} 104}
107 105
108void sendMsg(u32 msg) 106void sendMsg(u32 msg)
109{ 107{
110 while (recv()==0) {sleep(1);} 108 while (recv()==0);
111 send(msg); 109 send(msg);
112 while (recv()!=0) {sleep(1);} 110 while (recv()!=0);
113 send(0); 111 send(0);
114} 112}
115 113
@@ -158,6 +156,6 @@ void waitForGame()
158 156
159void waitForAck() 157void waitForAck()
160{ 158{
161 while (recv() != 0) {sleep(1);}; 159 while (recv() != 0) {sleep(1);}
162 send(0); 160 send(0);
163} 161}