diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-07-13 20:52:35 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-07-13 20:52:35 -0400 |
commit | 07774bfa274462a74da04222712d5d096b1d14cb (patch) | |
tree | 5a29243ab611cc7150340f6b2f8a812b85660b2e /source/link.c | |
parent | 2190722ac1f0732cf35e7b63572afa698a47789d (diff) | |
download | gen3uploader-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!
Diffstat (limited to 'source/link.c')
-rw-r--r-- | source/link.c | 10 |
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 | ||
108 | void sendMsg(u32 msg) | 106 | void 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 | ||
159 | void waitForAck() | 157 | void waitForAck() |
160 | { | 158 | { |
161 | while (recv() != 0) {sleep(1);}; | 159 | while (recv() != 0) {sleep(1);} |
162 | send(0); | 160 | send(0); |
163 | } | 161 | } |