THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4KB

  1. #ifndef THREAD_COMPAT_H
  2. #define THREAD_COMPAT_H
  3. #ifndef NO_PTHREADS
  4. #include <pthread.h>
  5. #define HAVE_THREADS 1
  6. #else
  7. #define HAVE_THREADS 0
  8. /*
  9. * macros instead of typedefs because pthread definitions may have
  10. * been pulled in by some system dependencies even though the user
  11. * wants to disable pthread.
  12. */
  13. #define pthread_t int
  14. #define pthread_mutex_t int
  15. #define pthread_cond_t int
  16. #define pthread_key_t int
  17. #define pthread_mutex_init(mutex, attr) dummy_pthread_init(mutex)
  18. #define pthread_mutex_lock(mutex)
  19. #define pthread_mutex_unlock(mutex)
  20. #define pthread_mutex_destroy(mutex)
  21. #define pthread_cond_init(cond, attr) dummy_pthread_init(cond)
  22. #define pthread_cond_wait(cond, mutex)
  23. #define pthread_cond_signal(cond)
  24. #define pthread_cond_broadcast(cond)
  25. #define pthread_cond_destroy(cond)
  26. #define pthread_key_create(key, attr) dummy_pthread_init(key)
  27. #define pthread_key_delete(key)
  28. #define pthread_create(thread, attr, fn, data) \
  29. dummy_pthread_create(thread, attr, fn, data)
  30. #define pthread_join(thread, retval) \
  31. dummy_pthread_join(thread, retval)
  32. #define pthread_setspecific(key, data)
  33. #define pthread_getspecific(key) NULL
  34. int dummy_pthread_create(pthread_t *pthread, const void *attr,
  35. void *(*fn)(void *), void *data);
  36. int dummy_pthread_join(pthread_t pthread, void **retval);
  37. int dummy_pthread_init(void *);
  38. #endif
  39. int online_cpus(void);
  40. int init_recursive_mutex(pthread_mutex_t*);
  41. #endif /* THREAD_COMPAT_H */