diff options
author | H-M-H <henry@freedesk.net> | 2015-11-11 17:52:05 +0100 |
---|---|---|
committer | oy <Tom_Adams@web.de> | 2016-06-13 09:15:52 +0200 |
commit | 4ba1af2186878dad8cc02d040d98f8e060943218 (patch) | |
tree | b4d36995315694cc3388883b1806fefaf84516f8 | |
parent | 7dd463d1178e0c1277b5ae6cf0841a0f68e2408b (diff) |
fix compiling of 0.6 for mac osx
-rw-r--r-- | scripts/refactor_count.py | 2 | ||||
-rw-r--r-- | src/base/system.c | 6 | ||||
-rw-r--r-- | src/base/system.h | 8 | ||||
-rw-r--r-- | src/base/tl/threading.h | 2 | ||||
-rw-r--r-- | src/engine/client/backend_sdl.cpp | 2 | ||||
-rw-r--r-- | src/engine/client/client.cpp | 2 | ||||
-rw-r--r-- | src/engine/client/sound.cpp | 10 | ||||
-rw-r--r-- | src/engine/shared/jobs.cpp | 6 |
8 files changed, 19 insertions, 19 deletions
diff --git a/scripts/refactor_count.py b/scripts/refactor_count.py index 8fdec46e9..552f85398 100644 --- a/scripts/refactor_count.py +++ b/scripts/refactor_count.py @@ -25,7 +25,7 @@ allowed_words += [ # system.h "int64", "dbg_assert", "dbg_msg", "dbg_break", "dbg_logger_stdout", "dbg_logger_debugger", "dbg_logger_file", "mem_alloc", "mem_zero", "mem_free", "mem_copy", "mem_move", "mem_comp", "mem_stats", "total_allocations", "allocated", - "thread_create", "thread_sleep", "lock_wait", "lock_create", "lock_release", "lock_destroy", "swap_endian", + "thread_init", "thread_sleep", "lock_wait", "lock_create", "lock_unlock", "lock_destroy", "swap_endian", "io_open", "io_read", "io_read", "io_write", "io_flush", "io_close", "io_seek", "io_skip", "io_tell", "io_length", "str_comp", "str_length", "str_quickhash", "str_format", "str_copy", "str_comp_nocase", "str_sanitize", "str_append", "str_comp_num", "str_find_nocase", "str_sanitize_strong", "str_uppercase", "str_toint", "str_tofloat", diff --git a/src/base/system.c b/src/base/system.c index b4bc6fb0e..ca6400756 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -370,7 +370,7 @@ int io_flush(IOHANDLE io) return 0; } -void *thread_create(void (*threadfunc)(void *), void *u) +void *thread_init(void (*threadfunc)(void *), void *u) { #if defined(CONF_FAMILY_UNIX) pthread_t id; @@ -474,7 +474,7 @@ void lock_destroy(LOCK lock) mem_free(lock); } -int lock_try(LOCK lock) +int lock_trylock(LOCK lock) { #if defined(CONF_FAMILY_UNIX) return pthread_mutex_trylock((LOCKINTERNAL *)lock); @@ -496,7 +496,7 @@ void lock_wait(LOCK lock) #endif } -void lock_release(LOCK lock) +void lock_unlock(LOCK lock) { #if defined(CONF_FAMILY_UNIX) pthread_mutex_unlock((LOCKINTERNAL *)lock); diff --git a/src/base/system.h b/src/base/system.h index 125de11b8..ec208096b 100644 --- a/src/base/system.h +++ b/src/base/system.h @@ -352,7 +352,7 @@ IOHANDLE io_stderr(); void thread_sleep(int milliseconds); /* - Function: thread_create + Function: thread_init Creates a new thread. Parameters: @@ -360,7 +360,7 @@ void thread_sleep(int milliseconds); 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 @@ -403,9 +403,9 @@ typedef void* LOCK; LOCK lock_create(); void lock_destroy(LOCK lock); -int lock_try(LOCK lock); +int lock_trylock(LOCK lock); void lock_wait(LOCK lock); -void lock_release(LOCK lock); +void lock_unlock(LOCK lock); /* Group: Semaphores */ diff --git a/src/base/tl/threading.h b/src/base/tl/threading.h index 2cfbc0523..2b61c779f 100644 --- a/src/base/tl/threading.h +++ b/src/base/tl/threading.h @@ -84,7 +84,7 @@ class lock LOCK var; void take() { lock_wait(var); } - void release() { lock_release(var); } + void release() { lock_unlock(var); } public: lock() diff --git a/src/engine/client/backend_sdl.cpp b/src/engine/client/backend_sdl.cpp index 37d1019ae..502b41bd6 100644 --- a/src/engine/client/backend_sdl.cpp +++ b/src/engine/client/backend_sdl.cpp @@ -40,7 +40,7 @@ void CGraphicsBackend_Threaded::StartProcessor(ICommandProcessor *pProcessor) { m_Shutdown = false; m_pProcessor = pProcessor; - m_pThread = thread_create(ThreadFunc, this); + m_pThread = thread_init(ThreadFunc, this); m_BufferDone.signal(); } diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index b3c599414..2bf3d489d 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -1908,7 +1908,7 @@ void CClient::Run() m_EditorActive = false; Update(); - + if(!g_Config.m_GfxAsyncRender || m_pGraphics->IsIdle()) { m_RenderFrames++; diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp index 343fa2e86..4c64422e8 100644 --- a/src/engine/client/sound.cpp +++ b/src/engine/client/sound.cpp @@ -171,7 +171,7 @@ static void Mix(short *pFinalOut, unsigned Frames) // release the lock - lock_release(m_SoundLock); + lock_unlock(m_SoundLock); { // clamp accumulated values @@ -259,7 +259,7 @@ int CSound::Update() { lock_wait(m_SoundLock); m_SoundVolume = WantedVolume; - lock_release(m_SoundLock); + lock_unlock(m_SoundLock); } return 0; @@ -476,7 +476,7 @@ int CSound::Play(int ChannelID, int SampleID, int Flags, float x, float y) m_aVoices[VoiceID].m_Y = (int)y; } - lock_release(m_SoundLock); + lock_unlock(m_SoundLock); return VoiceID; } @@ -506,7 +506,7 @@ void CSound::Stop(int SampleID) m_aVoices[i].m_pSample = 0; } } - lock_release(m_SoundLock); + lock_unlock(m_SoundLock); } void CSound::StopAll() @@ -524,7 +524,7 @@ void CSound::StopAll() } m_aVoices[i].m_pSample = 0; } - lock_release(m_SoundLock); + lock_unlock(m_SoundLock); } IOHANDLE CSound::ms_File = 0; diff --git a/src/engine/shared/jobs.cpp b/src/engine/shared/jobs.cpp index 02db4634d..eca787d15 100644 --- a/src/engine/shared/jobs.cpp +++ b/src/engine/shared/jobs.cpp @@ -30,7 +30,7 @@ void CJobPool::WorkerThread(void *pUser) else pPool->m_pLastJob = 0; } - lock_release(pPool->m_Lock); + lock_unlock(pPool->m_Lock); // do the job if we have one if(pJob) @@ -49,7 +49,7 @@ int CJobPool::Init(int NumThreads) { // start threads for(int i = 0; i < NumThreads; i++) - thread_create(WorkerThread, this); + thread_init(WorkerThread, this); return 0; } @@ -69,7 +69,7 @@ int CJobPool::Add(CJob *pJob, JOBFUNC pfnFunc, void *pData) if(!m_pFirstJob) m_pFirstJob = pJob; - lock_release(m_Lock); + lock_unlock(m_Lock); return 0; } |