Added peekNetworkPacket()

This commit is contained in:
Kayne Ruse
2013-06-17 10:12:20 +10:00
parent 3d92fb77b3
commit d1aac9ffd8
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -32,6 +32,16 @@ int networkQueue(void*) {
}
}
Packet peekNetworkPacket() {
SDL_SemWait(lock);
Packet p;
if (queue.size() > 0) {
Packet p = queue[0];
}
SDL_SemPost(lock);
return p;
}
Packet popNetworkPacket() {
SDL_SemWait(lock);
Packet p;