Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pthread_mutex_init returns EOPNOTSUPP(95) #3449

Closed
sacredaioros opened this issue Aug 8, 2018 · 1 comment
Closed

pthread_mutex_init returns EOPNOTSUPP(95) #3449

sacredaioros opened this issue Aug 8, 2018 · 1 comment

Comments

@sacredaioros
Copy link

This is my test code:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>

int main(int args, char **argv)
{
    pthread_mutex_t mut;
    pthread_mutexattr_t attr;
    pthread_mutexattr_init(&attr);
    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
    pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);
    int eno = pthread_mutex_init(&mut, &attr);
    printf("pthread_mutex_init errno=%d\n", eno);
    pthread_mutexattr_destroy(&attr);
    pthread_mutex_destroy(&mut);
}

The outpt is pthread_mutex_init errno=95
I googled for a whole day but get nothing. Thank you for your help.
My Windows version is 10.0.17134.167.
My WSL version is Linux version 4.4.0-17134-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #137-Microsoft Thu Jun 14 18:46:00 PST 2018

@therealkenc
Copy link
Collaborator

10.0.17134.167

Returns 0 here. #1006. You want 17627. Note the caveat in the release notes. I haven't seen recursive locks in the wild, so if you run into behavioural issues with the lock (contrast the return value success) do feel encouraged to spin up a new submission. If you do, citing your use case helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants