Ignore:
Timestamp:
2018-07-05T21:41:20Z (7 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7e7c1aac
Parents:
c4049e6
git-author:
Dzejrou <dzejrou@…> (2018-03-28 14:21:53)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:20)
Message:

cpp: added a threading middle layer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/impl/mutex.hpp

    rc4049e6 r9283830  
    3131
    3232#include <internal/common.hpp>
     33#include <internal/thread.hpp>
    3334#include <thread>
    3435
    3536namespace std
    3637{
    37     extern "C" {
    38         #include <fibril.h>
    39         #include <fibril_synch.h>
    40     }
    41 
    4238    /**
    4339     * 20.4.1.2.1, class mutex:
     
    4743    {
    4844        public:
    49             constexpr mutex() noexcept;
     45            constexpr mutex() noexcept
     46                : mtx_{}
     47            {
     48                aux::threading::mutex::init(mtx_);
     49            }
     50
    5051            ~mutex();
    5152
     
    5758            void unlock();
    5859
    59             using native_handle_type = fibril_mutex_t*;
     60            using native_handle_type = aux::mutex_t*;
    6061            native_handle_type native_handle();
    6162
    6263        private:
    63             native_handle_type mtx_;
     64            aux::mutex_t mtx_;
    6465    };
    6566
     
    8182            void unlock();
    8283
    83             using native_handle_type = fibril_mutex_t*;
     84            using native_handle_type = aux::mutex_t*;
    8485            native_handle_type native_handle();
    8586
    8687        private:
    87             native_handle_type mtx_;
     88            aux::mutex_t mtx_;
    8889            size_t lock_level_;
    8990            thread::id owner_;
Note: See TracChangeset for help on using the changeset viewer.