aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-17 09:14:03 -0700
committerChris Robinson <[email protected]>2014-04-17 09:14:03 -0700
commit4b5e8b8c407354d94203a59fff8af59ce7d2b5e4 (patch)
treeb53045d7064d3f6264892ac3c8dd2473cb9a0a02 /Alc
parentd1f1a1d056b654bbe52c0b1ba6752b7a106482e1 (diff)
Don't inline al_nssleep
Diffstat (limited to 'Alc')
-rw-r--r--Alc/threads.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/Alc/threads.c b/Alc/threads.c
index b43b1889..35c66c6c 100644
--- a/Alc/threads.c
+++ b/Alc/threads.c
@@ -40,8 +40,6 @@ extern inline int almtx_trylock(almtx_t *mtx);
extern inline void *altss_get(altss_t tss_id);
extern inline int altss_set(altss_t tss_id, void *val);
-extern inline void al_nssleep(time_t sec, long nsec);
-
#define THREAD_STACK_SIZE (1*1024*1024) /* 1MB */
@@ -462,3 +460,14 @@ int altimespec_get(struct timespec *ts, int base)
}
#endif
+
+
+void al_nssleep(time_t sec, long nsec)
+{
+ struct timespec ts, rem;
+ ts.tv_sec = sec;
+ ts.tv_nsec = nsec;
+
+ while(althrd_sleep(&ts, &rem) == -1)
+ ts = rem;
+}