X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fpbd%2Fpbd%2Fpthread_utils.h;h=ee78819d59d968a47070d7dcb4c3de6528233068;hb=8d0ec2403f3444e3a53d16b21f2f8557abd71b55;hp=37ce72371514a5c6312d6feb79c8ededd609e408;hpb=37b1f5017e904005fae6b815b1519b3fa595d8d3;p=ardour.git diff --git a/libs/pbd/pbd/pthread_utils.h b/libs/pbd/pbd/pthread_utils.h index 37ce723715..ee78819d59 100644 --- a/libs/pbd/pbd/pthread_utils.h +++ b/libs/pbd/pbd/pthread_utils.h @@ -20,6 +20,21 @@ #ifndef __pbd_pthread_utils__ #define __pbd_pthread_utils__ +/* Accommodate thread setting (and testing) for both + * 'libpthread' and 'libpthread_win32' (whose implementations + * of 'pthread_t' are subtlely different) + */ +#ifndef PTHREAD_MACROS_DEFINED +#define PTHREAD_MACROS_DEFINED +#ifdef PTW32_VERSION /* pthread_win32 */ +#define mark_pthread_inactive(threadID) threadID.p=0 +#define is_pthread_active(threadID) threadID.p==0 +#else /* normal pthread */ +#define mark_pthread_inactive(threadID) threadID=0 +#define is_pthread_active(threadID) threadID==0 +#endif /* PTW32_VERSION */ +#endif /* PTHREAD_MACROS_DEFINED */ + #ifdef COMPILER_MSVC #include #else