mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 03:04:33 +02:00
#19171 move of usleep function to SharedUtil.cpp
This commit is contained in:
parent
6a5c51bc69
commit
d6189694c8
3 changed files with 24 additions and 12 deletions
|
@ -311,18 +311,6 @@ void AgentList::stopSilentAgentRemovalThread() {
|
|||
pthread_join(removeSilentAgentsThread, NULL);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
void usleep(int waitTime) {
|
||||
__int64 time1 = 0, time2 = 0, sysFreq = 0;
|
||||
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&time1);
|
||||
QueryPerformanceFrequency((LARGE_INTEGER *)&sysFreq);
|
||||
do {
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&time2);
|
||||
} while( (time2 - time1) < waitTime);
|
||||
}
|
||||
#endif
|
||||
|
||||
void *checkInWithDomainServer(void *args) {
|
||||
|
||||
AgentList *parentAgentList = (AgentList *)args;
|
||||
|
|
|
@ -9,6 +9,9 @@
|
|||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#ifdef _WIN32
|
||||
#include "Syssocket.h"
|
||||
#endif
|
||||
#include "SharedUtil.h"
|
||||
#include "OctalCode.h"
|
||||
|
||||
|
@ -16,6 +19,11 @@
|
|||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#endif
|
||||
|
||||
|
||||
double usecTimestamp(timeval *time) {
|
||||
return (time->tv_sec * 1000000.0 + time->tv_usec);
|
||||
}
|
||||
|
@ -336,3 +344,15 @@ void printVoxelCode(unsigned char* voxelCode) {
|
|||
outputBits(voxelCode[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
void usleep(int waitTime) {
|
||||
__int64 time1 = 0, time2 = 0, sysFreq = 0;
|
||||
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&time1);
|
||||
QueryPerformanceFrequency((LARGE_INTEGER *)&sysFreq);
|
||||
do {
|
||||
QueryPerformanceCounter((LARGE_INTEGER *)&time2);
|
||||
} while( (time2 - time1) < waitTime);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -50,4 +50,8 @@ unsigned char* pointToVoxel(float x, float y, float z, float s, unsigned char r,
|
|||
bool createVoxelEditMessage(unsigned char command, short int sequence,
|
||||
int voxelCount, VoxelDetail* voxelDetails, unsigned char*& bufferOut, int& sizeOut);
|
||||
|
||||
#ifdef _WIN32
|
||||
void usleep(int waitTime);
|
||||
#endif
|
||||
|
||||
#endif /* defined(__hifi__SharedUtil__) */
|
||||
|
|
Loading…
Reference in a new issue