X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fthread.h;h=79f3e713c34bf99d293e96a12f1ae3f32113a78b;hb=ba9e9e32512994d5bccdd782bce844b2338992b7;hp=216ecd2b7ec77e5da823834650b25383ef9df76b;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/guicast/thread.h b/cinelerra-5.1/guicast/thread.h index 216ecd2b..79f3e713 100644 --- a/cinelerra-5.1/guicast/thread.h +++ b/cinelerra-5.1/guicast/thread.h @@ -25,9 +25,17 @@ #include #include #include + +#ifndef NO_TID #include +// 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); } +#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.