reducing thread consumption. One thread is still updated as often as possible, but i don't know which.
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/hilnius@13195 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
12075a19b7
commit
ebc4c60e2c
@ -21,6 +21,7 @@
|
||||
#include "network/protocol.hpp"
|
||||
#include "network/network_manager.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
#include <cstdlib>
|
||||
@ -33,6 +34,7 @@ void* protocolManagerUpdate(void* data)
|
||||
while(!manager->exit())
|
||||
{
|
||||
manager->update();
|
||||
irr_driver->getDevice()->sleep(20);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ void* STKHost::receive_data(void* self)
|
||||
ENetHost* host = (((STKHost*)(self))->m_host);
|
||||
while (1)
|
||||
{
|
||||
while (enet_host_service(host, &event, 0) != 0) {
|
||||
while (enet_host_service(host, &event, 20) != 0) {
|
||||
Event* evt = new Event(&event);
|
||||
if (event.type != ENET_EVENT_TYPE_NONE)
|
||||
NetworkManager::getInstance()->notifyEvent(evt);
|
||||
|
Loading…
x
Reference in New Issue
Block a user