| * On Linux 2.6 and later, we can use pthreads (in fact, we must), |
| * but on earlier Linux, pthreads are incompatible with using our |
| * own coroutines in libthread. In order to make binaries that work |
| * on either system, we detect the pthread library in use and call |
| * the appropriate functions. |
| #define _procsleep _procsleep_signal |
| #define _procwakeup _procwakeup_signal |
| #include "rendez-signal.c" |
| #define _procsleep _procsleep_pthread |
| #define _procwakeup _procwakeup_pthread |
| #include "rendez-pthread.c" |
| if(confstr(_CS_GNU_LIBPTHREAD_VERSION, buf, sizeof buf) > 0 |
| && strncmp(buf, "NPTL", 4) == 0) |
| return _procsleep_pthread(r); |
| return _procsleep_signal(r); |
| _procwakeup(_Procrend *r) |
| return _procwakeup_pthread(r); |
| return _procwakeup_signal(r); |