Merge branch 'feature/pthread_condattr_dummy_impl' into 'master'

feat(pthread): added pthread_condattr* stubs to avoid linker errors

Closes IDFGH-10982

See merge request espressif/esp-idf!26112
This commit is contained in:
Jakob Hasse
2023-10-02 23:05:11 +08:00
2 changed files with 34 additions and 7 deletions

View File

@@ -8,12 +8,6 @@
const static char *TAG = "esp32_asio_pthread";
int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id)
{
ESP_LOGW(TAG, "%s: not yet supported!", __func__);
return 0;
}
int pthread_setcancelstate(int state, int *oldstate)
{
return 0;

View File

@@ -175,12 +175,45 @@ int pthread_cond_timedwait(pthread_cond_t *cv, pthread_mutex_t *mut, const struc
return ret;
}
// The following pthread_condattr_* function definitions are placed here to enable builds of code
// that references these functions but does not actively use them.
int pthread_condattr_init(pthread_condattr_t *attr)
{
ESP_LOGV(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr);
ESP_LOGW(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr);
return ENOSYS;
}
int pthread_condattr_destroy(pthread_condattr_t *attr)
{
ESP_LOGW(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr);
return ENOSYS;
}
int pthread_condattr_getpshared(const pthread_condattr_t *restrict attr, int *restrict pshared)
{
ESP_LOGW(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr);
return ENOSYS;
}
int pthread_condattr_setpshared(pthread_condattr_t *attr, int pshared)
{
ESP_LOGW(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr);
return ENOSYS;
}
int pthread_condattr_getclock(const pthread_condattr_t *restrict attr, clockid_t *restrict clock_id)
{
ESP_LOGW(TAG, "%s not yet implemented (%p)", __FUNCTION__, attr);
return ENOSYS;
}
int pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id)
{
ESP_LOGW(TAG, "%s: not yet supported!", __func__);
return 0; // moved here from newlib, where it was 0 instead of ENOSYS
}
int pthread_cond_init(pthread_cond_t *cv, const pthread_condattr_t *att)
{
(void) att; /* Unused argument as of now */