GithubHelp home page GithubHelp logo

Comments (4)

pjbakker avatar pjbakker commented on May 14, 2024

Fixed for next release

from mbedtls.

mpg avatar mpg commented on May 14, 2024

I'm afraid I disagree here :) The current code only work with pthreads indeed since it needs to initialize a global mutex. The following line will not compile with a non-pthread imlementation:

 static threading_mutex_t readdir_mutex = PTHREAD_MUTEX_INITIALIZER;

Some threading implementations do not provide similar static initializers. (Btw, the fact that using phtreads here is intentional is reflected in the function's documentation, see the warning.)

It is possible, however, to initialise global mutexes in threading_set_alt() but, in case it allocates some resources, then the user will have to call threading_free_alt(), a function that currently doesn't exist, or the resources will be lost. (OTOH, since you usually call threading_set_alt() only once, and the mutexes are most likely need till the end of the program anyway, it's not much of a leak.) (Paul, you can check the internal branch threading-1.4 (only one commit) for how I planned to handle global mutexes.)

So I thought it might be better to wait for the next API change to introduce global mutexes. But maybe it's also OK to make this change now but mention it clearly in the release notes?

from mbedtls.

pjbakker avatar pjbakker commented on May 14, 2024

@mpg You are totally right.. Missed that part..
Ok, so this one stays pthread-only for at least this 1.3 branch. Should be properly documented to prevent my mistaken fix in the future though!

from mbedtls.

mpg avatar mpg commented on May 14, 2024

This is fixed in the 2.0 branch (currently internal, hopefully release in the next few weeks).

from mbedtls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.