Hopefully fix compilation on new OS X systems

Names collided with some new OS X defined names, fixes #189
This commit is contained in:
def 2015-04-07 19:07:38 +02:00
parent 47f77b426a
commit 3992b1346b
11 changed files with 67 additions and 67 deletions

View file

@ -179,7 +179,7 @@ void dbg_enable_threaded()
dbg_msg_threaded = 1; dbg_msg_threaded = 1;
Thread = thread_create(dbg_msg_thread, 0); Thread = thread_init(dbg_msg_thread, 0);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)Thread); pthread_detach((pthread_t)Thread);
#endif #endif
@ -504,7 +504,7 @@ int io_flush(IOHANDLE io)
return 0; return 0;
} }
void *thread_create(void (*threadfunc)(void *), void *u) void *thread_init(void (*threadfunc)(void *), void *u)
{ {
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_t id; pthread_t id;
@ -608,7 +608,7 @@ void lock_destroy(LOCK lock)
mem_free(lock); mem_free(lock);
} }
int lock_try(LOCK lock) int lock_trylock(LOCK lock)
{ {
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
return pthread_mutex_trylock((LOCKINTERNAL *)lock); return pthread_mutex_trylock((LOCKINTERNAL *)lock);
@ -630,7 +630,7 @@ void lock_wait(LOCK lock)
#endif #endif
} }
void lock_release(LOCK lock) void lock_unlock(LOCK lock)
{ {
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_mutex_unlock((LOCKINTERNAL *)lock); pthread_mutex_unlock((LOCKINTERNAL *)lock);

View file

@ -353,7 +353,7 @@ IOHANDLE io_stderr();
void thread_sleep(int milliseconds); void thread_sleep(int milliseconds);
/* /*
Function: thread_create Function: thread_init
Creates a new thread. Creates a new thread.
Parameters: Parameters:
@ -361,7 +361,7 @@ void thread_sleep(int milliseconds);
user - Pointer to pass to the thread. user - Pointer to pass to the thread.
*/ */
void *thread_create(void (*threadfunc)(void *), void *user); void *thread_init(void (*threadfunc)(void *), void *user);
/* /*
Function: thread_wait Function: thread_wait
@ -404,9 +404,9 @@ typedef void* LOCK;
LOCK lock_create(); LOCK lock_create();
void lock_destroy(LOCK lock); void lock_destroy(LOCK lock);
int lock_try(LOCK lock); int lock_trylocklock(LOCK lock);
void lock_wait(LOCK lock); void lock_wait(LOCK lock);
void lock_release(LOCK lock); void lock_unlock(LOCK lock);
/* Group: Semaphores */ /* Group: Semaphores */

View file

@ -84,7 +84,7 @@ class lock
LOCK var; LOCK var;
void take() { lock_wait(var); } void take() { lock_wait(var); }
void release() { lock_release(var); } void release() { lock_unlock(var); }
public: public:
lock() lock()

View file

@ -63,7 +63,7 @@ void CGraphicsBackend_Threaded::StartProcessor(ICommandProcessor *pProcessor)
{ {
m_Shutdown = false; m_Shutdown = false;
m_pProcessor = pProcessor; m_pProcessor = pProcessor;
m_pThread = thread_create(ThreadFunc, this); m_pThread = thread_init(ThreadFunc, this);
m_BufferDone.signal(); m_BufferDone.signal();
} }

View file

@ -45,7 +45,7 @@ void CFetcher::QueueAdd(CFetchTask *pTask, const char *pUrl, const char *pDest,
lock_wait(m_Lock); lock_wait(m_Lock);
if(!m_pThHandle) if(!m_pThHandle)
{ {
m_pThHandle = thread_create(&FetcherThread, this); m_pThHandle = thread_init(&FetcherThread, this);
thread_detach(m_pThHandle); thread_detach(m_pThHandle);
} }
@ -60,7 +60,7 @@ void CFetcher::QueueAdd(CFetchTask *pTask, const char *pUrl, const char *pDest,
m_pLast = pTask; m_pLast = pTask;
} }
pTask->m_State = CFetchTask::STATE_QUEUED; pTask->m_State = CFetchTask::STATE_QUEUED;
lock_release(m_Lock); lock_unlock(m_Lock);
} }
void CFetcher::Escape(char *pBuf, size_t size, const char *pStr) void CFetcher::Escape(char *pBuf, size_t size, const char *pStr)
@ -80,7 +80,7 @@ void CFetcher::FetcherThread(void *pUser)
CFetchTask *pTask = pFetcher->m_pFirst; CFetchTask *pTask = pFetcher->m_pFirst;
if(pTask) if(pTask)
pFetcher->m_pFirst = pTask->m_pNext; pFetcher->m_pFirst = pTask->m_pNext;
lock_release(pFetcher->m_Lock); lock_unlock(pFetcher->m_Lock);
if(pTask) if(pTask)
{ {
dbg_msg("fetcher", "Task got %s:%s", pTask->m_pUrl, pTask->m_pDest); dbg_msg("fetcher", "Task got %s:%s", pTask->m_pUrl, pTask->m_pDest);

View file

@ -252,7 +252,7 @@ static void Mix(short *pFinalOut, unsigned Frames)
// release the lock // release the lock
lock_release(m_SoundLock); lock_unlock(m_SoundLock);
{ {
// clamp accumulated values // clamp accumulated values
@ -340,7 +340,7 @@ int CSound::Update()
{ {
lock_wait(m_SoundLock); lock_wait(m_SoundLock);
m_SoundVolume = WantedVolume; m_SoundVolume = WantedVolume;
lock_release(m_SoundLock); lock_unlock(m_SoundLock);
} }
return 0; return 0;
@ -777,7 +777,7 @@ void CSound::SetVoiceTimeOffset(CVoiceHandle Voice, float offset)
} }
} }
} }
lock_release(m_SoundLock); lock_unlock(m_SoundLock);
} }
void CSound::SetVoiceCircle(CVoiceHandle Voice, float Radius) void CSound::SetVoiceCircle(CVoiceHandle Voice, float Radius)
@ -854,7 +854,7 @@ ISound::CVoiceHandle CSound::Play(int ChannelID, int SampleID, int Flags, float
Age = m_aVoices[VoiceID].m_Age; Age = m_aVoices[VoiceID].m_Age;
} }
lock_release(m_SoundLock); lock_unlock(m_SoundLock);
return CreateVoiceHandle(VoiceID, Age); return CreateVoiceHandle(VoiceID, Age);
} }
@ -884,7 +884,7 @@ void CSound::Stop(int SampleID)
m_aVoices[i].m_pSample = 0; m_aVoices[i].m_pSample = 0;
} }
} }
lock_release(m_SoundLock); lock_unlock(m_SoundLock);
} }
void CSound::StopAll() void CSound::StopAll()
@ -902,7 +902,7 @@ void CSound::StopAll()
} }
m_aVoices[i].m_pSample = 0; m_aVoices[i].m_pSample = 0;
} }
lock_release(m_SoundLock); lock_unlock(m_SoundLock);
} }
void CSound::StopVoice(CVoiceHandle Voice) void CSound::StopVoice(CVoiceHandle Voice)
@ -920,7 +920,7 @@ void CSound::StopVoice(CVoiceHandle Voice)
m_aVoices[VoiceID].m_pSample = 0; m_aVoices[VoiceID].m_pSample = 0;
m_aVoices[VoiceID].m_Age++; m_aVoices[VoiceID].m_Age++;
} }
lock_release(m_SoundLock); lock_unlock(m_SoundLock);
} }

View file

@ -15,7 +15,7 @@ static volatile bool gs_stopFifoThread = false;
FifoConsole::FifoConsole(IConsole *pConsole, char *pFifoFile, int flag) FifoConsole::FifoConsole(IConsole *pConsole, char *pFifoFile, int flag)
{ {
m_pFifoThread = thread_create(ListenFifoThread, this); m_pFifoThread = thread_init(ListenFifoThread, this);
m_pConsole = pConsole; m_pConsole = pConsole;
m_pFifoFile = pFifoFile; m_pFifoFile = pFifoFile;
m_flag = flag; m_flag = flag;
@ -31,7 +31,7 @@ FifoConsole::~FifoConsole()
{ {
lock_wait(gs_FifoLock); lock_wait(gs_FifoLock);
gs_stopFifoThread = true; gs_stopFifoThread = true;
lock_release(gs_FifoLock); lock_unlock(gs_FifoLock);
gs_FifoLock = 0; gs_FifoLock = 0;
} }
@ -50,7 +50,7 @@ void FifoConsole::ListenFifoThread(void *pUser)
struct stat attribute; struct stat attribute;
stat(pData->m_pFifoFile, &attribute); stat(pData->m_pFifoFile, &attribute);
lock_release(gs_FifoLock); lock_unlock(gs_FifoLock);
if(!S_ISFIFO(attribute.st_mode)) if(!S_ISFIFO(attribute.st_mode))
return; return;

View file

@ -30,7 +30,7 @@ void CJobPool::WorkerThread(void *pUser)
else else
pPool->m_pLastJob = 0; pPool->m_pLastJob = 0;
} }
lock_release(pPool->m_Lock); lock_unlock(pPool->m_Lock);
// do the job if we have one // do the job if we have one
if(pJob) if(pJob)
@ -49,7 +49,7 @@ int CJobPool::Init(int NumThreads)
{ {
// start threads // start threads
for(int i = 0; i < NumThreads; i++) for(int i = 0; i < NumThreads; i++)
thread_create(WorkerThread, this); thread_init(WorkerThread, this);
return 0; return 0;
} }
@ -69,7 +69,7 @@ int CJobPool::Add(CJob *pJob, JOBFUNC pfnFunc, void *pData)
if(!m_pFirstJob) if(!m_pFirstJob)
m_pFirstJob = pJob; m_pFirstJob = pJob;
lock_release(m_Lock); lock_unlock(m_Lock);
return 0; return 0;
} }

View file

@ -5156,7 +5156,7 @@ void CEditor::DoMapBorder()
void CEditor::CreateUndoStep() void CEditor::CreateUndoStep()
{ {
void *CreateThread = thread_create(CreateUndoStepThread, this); void *CreateThread = thread_init(CreateUndoStepThread, this);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)CreateThread); pthread_detach((pthread_t)CreateThread);
#endif #endif

View file

@ -38,7 +38,7 @@ CFileScore::~CFileScore()
// clear list // clear list
m_Top.clear(); m_Top.clear();
lock_release(gs_ScoreLock); lock_unlock(gs_ScoreLock);
} }
std::string SaveFile() std::string SaveFile()
@ -90,12 +90,12 @@ void CFileScore::SaveScoreThread(void *pUser)
} }
} }
f.close(); f.close();
lock_release(gs_ScoreLock); lock_unlock(gs_ScoreLock);
} }
void CFileScore::Save() void CFileScore::Save()
{ {
void *pSaveThread = thread_create(SaveScoreThread, this); void *pSaveThread = thread_init(SaveScoreThread, this);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)pSaveThread); pthread_detach((pthread_t)pSaveThread);
#endif #endif
@ -139,7 +139,7 @@ void CFileScore::Init()
} }
} }
f.close(); f.close();
lock_release(gs_ScoreLock); lock_unlock(gs_ScoreLock);
// save the current best score // save the current best score
if (m_Top.size()) if (m_Top.size())
@ -200,7 +200,7 @@ void CFileScore::UpdatePlayer(int ID, float Score,
else else
m_Top.add(*new CPlayerScore(pName, Score, aCpTime)); m_Top.add(*new CPlayerScore(pName, Score, aCpTime));
lock_release(gs_ScoreLock); lock_unlock(gs_ScoreLock);
Save(); Save();
} }
@ -210,7 +210,7 @@ void CFileScore::LoadScore(int ClientID)
if (pPlayer) if (pPlayer)
{ {
lock_wait(gs_ScoreLock); lock_wait(gs_ScoreLock);
lock_release(gs_ScoreLock); lock_unlock(gs_ScoreLock);
Save(); Save();
} }

View file

@ -37,7 +37,7 @@ CSqlScore::CSqlScore(CGameContext *pGameServer) : m_pGameServer(pGameServer),
CSqlScore::~CSqlScore() CSqlScore::~CSqlScore()
{ {
lock_wait(gs_SqlLock); lock_wait(gs_SqlLock);
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
try try
{ {
@ -268,7 +268,7 @@ void CSqlScore::LoadScoreThread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::LoadScore(int ClientID) void CSqlScore::LoadScore(int ClientID)
@ -278,7 +278,7 @@ void CSqlScore::LoadScore(int ClientID)
str_copy(Tmp->m_aName, Server()->ClientName(ClientID), MAX_NAME_LENGTH); str_copy(Tmp->m_aName, Server()->ClientName(ClientID), MAX_NAME_LENGTH);
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *LoadThread = thread_create(LoadScoreThread, Tmp); void *LoadThread = thread_init(LoadScoreThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)LoadThread); pthread_detach((pthread_t)LoadThread);
#endif #endif
@ -403,7 +403,7 @@ void CSqlScore::SaveTeamScoreThread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::MapVote(int ClientID, const char* MapName) void CSqlScore::MapVote(int ClientID, const char* MapName)
@ -413,7 +413,7 @@ void CSqlScore::MapVote(int ClientID, const char* MapName)
str_copy(Tmp->m_aMap, MapName, 128); str_copy(Tmp->m_aMap, MapName, 128);
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *VoteThread = thread_create(MapVoteThread, Tmp); void *VoteThread = thread_init(MapVoteThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)VoteThread); pthread_detach((pthread_t)VoteThread);
#endif #endif
@ -499,7 +499,7 @@ void CSqlScore::MapVoteThread(void *pUser)
} }
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::MapInfo(int ClientID, const char* MapName) void CSqlScore::MapInfo(int ClientID, const char* MapName)
@ -509,7 +509,7 @@ void CSqlScore::MapInfo(int ClientID, const char* MapName)
str_copy(Tmp->m_aMap, MapName, 128); str_copy(Tmp->m_aMap, MapName, 128);
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *InfoThread = thread_create(MapInfoThread, Tmp); void *InfoThread = thread_init(MapInfoThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)InfoThread); pthread_detach((pthread_t)InfoThread);
#endif #endif
@ -585,7 +585,7 @@ void CSqlScore::MapInfoThread(void *pUser)
} }
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::SaveScoreThread(void *pUser) void CSqlScore::SaveScoreThread(void *pUser)
@ -650,7 +650,7 @@ void CSqlScore::SaveScoreThread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::SaveScore(int ClientID, float Time, float CpTime[NUM_CHECKPOINTS]) void CSqlScore::SaveScore(int ClientID, float Time, float CpTime[NUM_CHECKPOINTS])
@ -666,7 +666,7 @@ void CSqlScore::SaveScore(int ClientID, float Time, float CpTime[NUM_CHECKPOINTS
Tmp->m_aCpCurrent[i] = CpTime[i]; Tmp->m_aCpCurrent[i] = CpTime[i];
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *SaveThread = thread_create(SaveScoreThread, Tmp); void *SaveThread = thread_init(SaveScoreThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)SaveThread); pthread_detach((pthread_t)SaveThread);
#endif #endif
@ -687,7 +687,7 @@ void CSqlScore::SaveTeamScore(int* aClientIDs, unsigned int Size, float Time)
Tmp->m_Time = Time; Tmp->m_Time = Time;
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *SaveTeamThread = thread_create(SaveTeamScoreThread, Tmp); void *SaveTeamThread = thread_init(SaveTeamScoreThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)SaveTeamThread); pthread_detach((pthread_t)SaveTeamThread);
#endif #endif
@ -775,7 +775,7 @@ void CSqlScore::ShowTeamRankThread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::ShowTeamTop5Thread(void *pUser) void CSqlScore::ShowTeamTop5Thread(void *pUser)
@ -877,7 +877,7 @@ void CSqlScore::ShowTeamTop5Thread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::ShowRankThread(void *pUser) void CSqlScore::ShowRankThread(void *pUser)
@ -944,7 +944,7 @@ void CSqlScore::ShowRankThread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::ShowTeamRank(int ClientID, const char* pName, bool Search) void CSqlScore::ShowTeamRank(int ClientID, const char* pName, bool Search)
@ -956,7 +956,7 @@ void CSqlScore::ShowTeamRank(int ClientID, const char* pName, bool Search)
str_format(Tmp->m_aRequestingPlayer, sizeof(Tmp->m_aRequestingPlayer), "%s", Server()->ClientName(ClientID)); str_format(Tmp->m_aRequestingPlayer, sizeof(Tmp->m_aRequestingPlayer), "%s", Server()->ClientName(ClientID));
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *TeamRankThread = thread_create(ShowTeamRankThread, Tmp); void *TeamRankThread = thread_init(ShowTeamRankThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)TeamRankThread); pthread_detach((pthread_t)TeamRankThread);
#endif #endif
@ -971,7 +971,7 @@ void CSqlScore::ShowRank(int ClientID, const char* pName, bool Search)
str_format(Tmp->m_aRequestingPlayer, sizeof(Tmp->m_aRequestingPlayer), "%s", Server()->ClientName(ClientID)); str_format(Tmp->m_aRequestingPlayer, sizeof(Tmp->m_aRequestingPlayer), "%s", Server()->ClientName(ClientID));
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *RankThread = thread_create(ShowRankThread, Tmp); void *RankThread = thread_init(ShowRankThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)RankThread); pthread_detach((pthread_t)RankThread);
#endif #endif
@ -1030,7 +1030,7 @@ void CSqlScore::ShowTop5Thread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::ShowTimesThread(void *pUser) void CSqlScore::ShowTimesThread(void *pUser)
@ -1115,7 +1115,7 @@ void CSqlScore::ShowTimesThread(void *pUser)
} }
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::ShowTeamTop5(IConsole::IResult *pResult, int ClientID, void *pUserData, int Debut) void CSqlScore::ShowTeamTop5(IConsole::IResult *pResult, int ClientID, void *pUserData, int Debut)
@ -1125,7 +1125,7 @@ void CSqlScore::ShowTeamTop5(IConsole::IResult *pResult, int ClientID, void *pUs
Tmp->m_ClientID = ClientID; Tmp->m_ClientID = ClientID;
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *TeamTop5Thread = thread_create(ShowTeamTop5Thread, Tmp); void *TeamTop5Thread = thread_init(ShowTeamTop5Thread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)TeamTop5Thread); pthread_detach((pthread_t)TeamTop5Thread);
#endif #endif
@ -1138,7 +1138,7 @@ void CSqlScore::ShowTop5(IConsole::IResult *pResult, int ClientID, void *pUserDa
Tmp->m_ClientID = ClientID; Tmp->m_ClientID = ClientID;
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *Top5Thread = thread_create(ShowTop5Thread, Tmp); void *Top5Thread = thread_init(ShowTop5Thread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)Top5Thread); pthread_detach((pthread_t)Top5Thread);
#endif #endif
@ -1152,7 +1152,7 @@ void CSqlScore::ShowTimes(int ClientID, int Debut)
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
Tmp->m_Search = false; Tmp->m_Search = false;
void *TimesThread = thread_create(ShowTimesThread, Tmp); void *TimesThread = thread_init(ShowTimesThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)TimesThread); pthread_detach((pthread_t)TimesThread);
#endif #endif
@ -1167,7 +1167,7 @@ void CSqlScore::ShowTimes(int ClientID, const char* pName, int Debut)
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
Tmp->m_Search = true; Tmp->m_Search = true;
void *TimesThread = thread_create(ShowTimesThread, Tmp); void *TimesThread = thread_init(ShowTimesThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)TimesThread); pthread_detach((pthread_t)TimesThread);
#endif #endif
@ -1360,7 +1360,7 @@ void CSqlScore::ShowPointsThread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::ShowPoints(int ClientID, const char* pName, bool Search) void CSqlScore::ShowPoints(int ClientID, const char* pName, bool Search)
@ -1372,7 +1372,7 @@ void CSqlScore::ShowPoints(int ClientID, const char* pName, bool Search)
str_format(Tmp->m_aRequestingPlayer, sizeof(Tmp->m_aRequestingPlayer), "%s", Server()->ClientName(ClientID)); str_format(Tmp->m_aRequestingPlayer, sizeof(Tmp->m_aRequestingPlayer), "%s", Server()->ClientName(ClientID));
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *PointsThread = thread_create(ShowPointsThread, Tmp); void *PointsThread = thread_init(ShowPointsThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)PointsThread); pthread_detach((pthread_t)PointsThread);
#endif #endif
@ -1426,7 +1426,7 @@ void CSqlScore::ShowTopPointsThread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::ShowTopPoints(IConsole::IResult *pResult, int ClientID, void *pUserData, int Debut) void CSqlScore::ShowTopPoints(IConsole::IResult *pResult, int ClientID, void *pUserData, int Debut)
@ -1436,7 +1436,7 @@ void CSqlScore::ShowTopPoints(IConsole::IResult *pResult, int ClientID, void *pU
Tmp->m_ClientID = ClientID; Tmp->m_ClientID = ClientID;
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *TopPointsThread = thread_create(ShowTopPointsThread, Tmp); void *TopPointsThread = thread_init(ShowTopPointsThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)TopPointsThread); pthread_detach((pthread_t)TopPointsThread);
#endif #endif
@ -1493,7 +1493,7 @@ void CSqlScore::RandomMapThread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::RandomUnfinishedMapThread(void *pUser) void CSqlScore::RandomUnfinishedMapThread(void *pUser)
@ -1551,7 +1551,7 @@ void CSqlScore::RandomUnfinishedMapThread(void *pUser)
delete pData; delete pData;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::RandomMap(int ClientID, int stars) void CSqlScore::RandomMap(int ClientID, int stars)
@ -1562,7 +1562,7 @@ void CSqlScore::RandomMap(int ClientID, int stars)
str_copy(Tmp->m_aName, GameServer()->Server()->ClientName(ClientID), MAX_NAME_LENGTH); str_copy(Tmp->m_aName, GameServer()->Server()->ClientName(ClientID), MAX_NAME_LENGTH);
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *RandomThread = thread_create(RandomMapThread, Tmp); void *RandomThread = thread_init(RandomMapThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)RandomThread); pthread_detach((pthread_t)RandomThread);
#endif #endif
@ -1576,7 +1576,7 @@ void CSqlScore::RandomUnfinishedMap(int ClientID, int stars)
str_copy(Tmp->m_aName, GameServer()->Server()->ClientName(ClientID), MAX_NAME_LENGTH); str_copy(Tmp->m_aName, GameServer()->Server()->ClientName(ClientID), MAX_NAME_LENGTH);
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *RandomUnfinishedThread = thread_create(RandomUnfinishedMapThread, Tmp); void *RandomUnfinishedThread = thread_init(RandomUnfinishedMapThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)RandomUnfinishedThread); pthread_detach((pthread_t)RandomUnfinishedThread);
#endif #endif
@ -1603,7 +1603,7 @@ void CSqlScore::SaveTeam(int Team, const char* Code, int ClientID, const char* S
str_copy(Tmp->m_Server, Server, sizeof(Tmp->m_Server)); str_copy(Tmp->m_Server, Server, sizeof(Tmp->m_Server));
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *SaveThread = thread_create(SaveTeamThread, Tmp); void *SaveThread = thread_init(SaveTeamThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)SaveThread); pthread_detach((pthread_t)SaveThread);
#endif #endif
@ -1705,7 +1705,7 @@ void CSqlScore::SaveTeamThread(void *pUser)
if(SavedTeam) if(SavedTeam)
delete SavedTeam; delete SavedTeam;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
void CSqlScore::LoadTeam(const char* Code, int ClientID) void CSqlScore::LoadTeam(const char* Code, int ClientID)
@ -1715,7 +1715,7 @@ void CSqlScore::LoadTeam(const char* Code, int ClientID)
Tmp->m_ClientID = ClientID; Tmp->m_ClientID = ClientID;
Tmp->m_pSqlData = this; Tmp->m_pSqlData = this;
void *LoadThread = thread_create(LoadTeamThread, Tmp); void *LoadThread = thread_init(LoadTeamThread, Tmp);
#if defined(CONF_FAMILY_UNIX) #if defined(CONF_FAMILY_UNIX)
pthread_detach((pthread_t)LoadThread); pthread_detach((pthread_t)LoadThread);
#endif #endif
@ -1851,7 +1851,7 @@ void CSqlScore::LoadTeamThread(void *pUser)
delete pData; delete pData;
delete SavedTeam; delete SavedTeam;
lock_release(gs_SqlLock); lock_unlock(gs_SqlLock);
} }
#endif #endif