projects
/
goodguy
/
cinelerra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
histogram rework to add sum_frames, update suv/cakewalk autorange icons, add new...
[goodguy/cinelerra.git]
/
cinelerra-5.1
/
guicast
/
thread.h
diff --git
a/cinelerra-5.1/guicast/thread.h
b/cinelerra-5.1/guicast/thread.h
index 216ecd2b7ec77e5da823834650b25383ef9df76b..79f3e713c34bf99d293e96a12f1ae3f32113a78b 100644
(file)
--- a/
cinelerra-5.1/guicast/thread.h
+++ b/
cinelerra-5.1/guicast/thread.h
@@
-25,9
+25,17
@@
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
+
+#ifndef NO_TID
#include <sys/syscall.h>
#include <sys/syscall.h>
+// glibc >= 2.30 provides gettid() in unistd
+#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 30)
static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
+#endif
+#else
+static inline long gettid() { return (long)pthread_self(); }
+#endif
// The thread does not autodelete by default.
// If autodelete is 1 the thread autodeletes.
// The thread does not autodelete by default.
// If autodelete is 1 the thread autodeletes.