pthread.c 963 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include <pthread.h>
  2. #include "esp_log.h"
  3. const static char *TAG = "esp32_asio_pthread";
  4. int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id)
  5. {
  6. ESP_LOGW(TAG, "%s: not yet supported!", __func__);
  7. return 0;
  8. }
  9. int pthread_setcancelstate(int state, int *oldstate)
  10. {
  11. return 0;
  12. }
  13. // This functions (pthread_sigmask(), sigfillset) are called from ASIO::signal_blocker to temporarily silence signals
  14. // Since signals are not yet supported in ESP pthread these functions serve as no-ops
  15. //
  16. int pthread_sigmask(int how, const sigset_t *restrict set, sigset_t *restrict oset)
  17. {
  18. ESP_LOGD(TAG, "%s: Signals not supported in ESP pthread", __func__);
  19. return 0;
  20. }
  21. int sigfillset(sigset_t *what)
  22. {
  23. ESP_LOGD(TAG, "%s: Signals not supported in ESP pthread", __func__);
  24. if (what != NULL) {
  25. *what = ~0;
  26. }
  27. return 0;
  28. }
  29. void newlib_include_pthread_impl(void)
  30. {
  31. // Linker hook, exists for no other purpose
  32. }