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

Backport of all the multi-threading modernization (3.2) #45618

Merged
merged 5 commits into from
Feb 18, 2021

Commits on Feb 18, 2021

  1. Modernize RWLock

    - Based on C++14's `shared_time_mutex`
    - No more need to allocate-deallocate or check for null
    - No pointer anymore, just a member variable
    - Platform-specific implementations no longer needed
    - Simpler for `NO_THREADS`
    RandomShaper committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    b450036 View commit details
    Browse the repository at this point in the history
  2. Modernize Mutex

    - Based on C++11's `mutex`
    - No more need to allocate-deallocate or check for null
    - No pointer anymore, just a member variable
    - Platform-specific implementations no longer needed
    - Simpler for `NO_THREADS`
    - `BinaryMutex` added for special cases as the non-recursive version
    - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
    - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
    RandomShaper committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    4ddcdc0 View commit details
    Browse the repository at this point in the history
  3. Modernize Semaphore

    - Based on C++11's `mutex` and `condition_variable`
    - No more need to allocate-deallocate or check for null
    - No pointer anymore, just a member variable
    - Platform-specific implementations no longer needed
    - Simpler for `NO_THREADS`
    RandomShaper committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    8f6a636 View commit details
    Browse the repository at this point in the history
  4. Modernize Thread

    - Based on C++11's `thread` and `thread_local`
    - No more need to allocate-deallocate or check for null
    - No pointer anymore, just a member variable
    - Platform-specific implementations no longer needed (except for the few cases of non-portable functions)
    - Simpler for `NO_THREADS`
    - Thread ids are now the same across platforms (main is 1; others follow)
    RandomShaper committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    6d89f67 View commit details
    Browse the repository at this point in the history
  5. Modernize atomics

    - Based on C++11's `atomic`
    - Reworked `SafeRefCount` (based on the rewrite by @hpvb)
    - Replaced free atomic functions by the new `SafeNumeric<T>`
    - Replaced wrong cases of `volatile` by the new `SafeFlag`
    - Platform-specific implementations no longer needed
    
    Co-authored-by: Hein-Pieter van Braam-Stewart <[email protected]>
    RandomShaper and hpvb committed Feb 18, 2021
    Configuration menu
    Copy the full SHA
    4485b43 View commit details
    Browse the repository at this point in the history