aboutsummaryrefslogtreecommitdiffstats
path: root/src/gos/gos_linux.c
diff options
context:
space:
mode:
authorinmarket <inmarket@ugfx.io>2017-08-16 16:49:02 +1000
committerinmarket <inmarket@ugfx.io>2017-08-16 16:49:02 +1000
commitd7b083da1e3fbc9355422bc29470c387e88389d7 (patch)
tree5b21b55ae61e54fb1bdad40aaf0f590385176c02 /src/gos/gos_linux.c
parent422e95becf719ab3dfc3e37d5fda1b6f37dd02fb (diff)
downloaduGFX-d7b083da1e3fbc9355422bc29470c387e88389d7.tar.gz
uGFX-d7b083da1e3fbc9355422bc29470c387e88389d7.tar.bz2
uGFX-d7b083da1e3fbc9355422bc29470c387e88389d7.zip
Remove long obsoleted (and dubious) functions gfxSemCounter() and gfxSemCounterI()
Diffstat (limited to 'src/gos/gos_linux.c')
-rw-r--r--src/gos/gos_linux.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/gos/gos_linux.c b/src/gos/gos_linux.c
index dac3838f..43371443 100644
--- a/src/gos/gos_linux.c
+++ b/src/gos/gos_linux.c
@@ -165,15 +165,12 @@ threadreturn_t gfxThreadWait(gfxThreadHandle thread) {
}
}
void gfxSemSignal(gfxSem *pSem) {
- if (gfxSemCounter(pSem) < pSem->max)
- sem_post(&pSem->sem);
- }
- semcount_t gfxSemCounter(gfxSem *pSem) {
int res;
res = 0;
sem_getvalue(&pSem->sem, &res);
- return res;
+ if (res < pSem->max)
+ sem_post(&pSem->sem);
}
#else
void gfxSemInit(gfxSem *pSem, semcount_t val, semcount_t limit) {
@@ -239,17 +236,6 @@ threadreturn_t gfxThreadWait(gfxThreadHandle thread) {
pthread_mutex_unlock(&pSem->mtx);
}
- semcount_t gfxSemCounter(gfxSem *pSem) {
- semcount_t res;
-
- // The locking is really only required if obtaining the count is a divisible operation
- // which it might be on a 8/16 bit processor with a 32 bit semaphore count.
- pthread_mutex_lock(&pSem->mtx);
- res = pSem->cnt;
- pthread_mutex_unlock(&pSem->mtx);
-
- return res;
- }
#endif // GFX_USE_POSIX_SEMAPHORES
#endif /* GFX_USE_OS_LINUX */