Merge pull request #183 from mniip/rb

RequestBroker fixes
This commit is contained in:
jacob1 2013-10-30 12:05:47 -07:00
commit 3fc84495ed
4 changed files with 22 additions and 2 deletions

View File

@ -7,12 +7,14 @@
#include "Config.h"
#include "Misc.h"
#include "icondoc.h"
#if defined(WIN)
#ifdef WIN
#include <shlobj.h>
#include <shlwapi.h>
#include <windows.h>
#else
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
#endif
#ifdef MACOSX
#include <mach-o/dyld.h>
@ -655,5 +657,17 @@ int splitsign(const char* str, char * type)
return 0;
}
void* millisleep(long int t)
{
#ifdef WIN
Sleep(t);
#else
struct timespec s;
s.tv_sec = t/1000;
s.tv_nsec = (t%1000)*10000000;
nanosleep(&s, NULL);
#endif
}
vector2d v2d_zero = {0,0};
matrix2d m2d_identity = {1,0,0,1};

View File

@ -88,6 +88,8 @@ void membwand(void * dest, void * src, size_t destsize, size_t srcsize);
int splitsign(const char* str, char * type = NULL);
void* millisleep(long int t);
// a b
// c d

View File

@ -52,6 +52,7 @@
#include "Misc.h"
#include "HTTP.h"
#include "MD5.h"
#include "Misc.h"
#ifdef WIN
#define PERROR SOCKET_ERROR
@ -599,7 +600,8 @@ char *http_async_req_stop(void *ctx, int *ret, int *len)
char *rxd;
if (cx->state != HTS_DONE)
while (!http_async_req_status(ctx)) ;
while (!http_async_req_status(ctx))
millisleep(1);
if (cx->host)
{

View File

@ -7,6 +7,7 @@
#include "RequestListener.h"
#include "ThumbRenderRequest.h"
#include "ImageRequest.h"
#include "Misc.h"
#include "client/Client.h"
#include "client/GameSave.h"
#include "graphics/Graphics.h"
@ -233,6 +234,7 @@ void RequestBroker::thumbnailQueueProcessTH()
}
}
pthread_mutex_unlock(&requestQueueMutex);
millisleep(1);
}
pthread_mutex_lock(&runningMutex);
thumbnailQueueRunning = false;