aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils/tasks.cpp
Commit message (Collapse)AuthorAgeFilesLines
* uhd: Replace Boost mutexes and locks with standard optionsMartin Braun2021-10-191-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a very mechanical task that could almost have been done with sed. Boost versions of mutexes and locks were removed, and replaced with std:: versions. The replacement tables are as follows: == Mutexes == - boost::mutex -> std::mutex - boost::recursive_mutex -> std::recursive_mutex Mutexes behave identically between Boost and std:: and have the same API. == Locks == C++11 has only two types of lock that we use/need in UHD: - std::lock_guard: Identical to boost::lock_guard - std::unique_lock: Identical to boost::unique_lock Boost also has boost::mutex::scoped_lock, which is a typedef for boost::unique_lock<>. However, we often have used scoped_lock where we meant to use lock_guard<>. The name is a bit misleading, "scoped lock" sounding a bit like an RAII mechanism. Therefore, some previous boost::mutex::scoped_lock are now std::lock_guard<>. std::unique_lock is required when doing more than RAII locking (i.e., unlocking, relocking, usage with condition variables, etc.). == Condition Variables == Condition variables were out of the scope of this lock/mutex change, but in UHD, we inconsistently use boost::condition vs. boost::condition_variable. The former is a templated version of the latter, and thus works fine with std::mutex'es. Therefore, some boost::condition_variable where changed to boost::condition. All locks and mutexes use `#include <mutex>`. The corresponding Boost includes were removed. In some cases, this exposed issues with implicit Boost includes elsewhere. The missing explicit includes were added.
* host: Update code base using clang-tidyMartin Braun2021-03-041-2/+2
| | | | | | | | | The checks from the new clang-tidy file are applied to the source tree using: $ find . -name "*.cpp" | sort -u | xargs \ --max-procs 8 --max-args 1 clang-tidy --format-style=file \ --fix -p /path/to/compile_commands.json
* uhd: Apply clang-format against all .cpp and .hpp files in host/Martin Braun2020-03-031-58/+58
| | | | | Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of files that clang-format gets applied against.
* utils: tasks: Use uhd::set_thread_name()Martin Braun2019-11-261-3/+1
| | | | | This is a more portable option to set thread names. References to pthreads are now limited to thread.cpp, where they belong.
* uhd: Replace all occurrences of boost::bind with std::bindMartin Braun2019-11-261-7/+8
| | | | | | | | | | | | | | | | | | | | | Note: Replacing everything with a lambda would be even better, but that can't be easily scripted so we'll do this as a first step to reduce the Boost footprint. This also removes occurences of #include <boost/bind.hpp>, and makes sure all usages of std::bind have an #include <functional>. clang-format wasn't always applied to minimize the changeset in this commit, however, it was applied to the blocks of #includes. Due to conflicts with other Boost libraries, the placeholders _1, _2, etc. could not be directly used, but had to be explicitly called out (as std::placeholders::_1, etc.). This makes the use of std::bind even uglier, which serves as another reminder that using std::bind (and even more so, boost::bind) should be avoided. nirio/rpc/rpc_client.cpp still contains a reference to boost::bind. It was not possible to remove it by simply doing a search and replace, so it will be removed in a separate commit.
* uhd: Update license headersMartin Braun2018-02-191-1/+2
| | | | | | | All copyright is now attributed to "Ettus Research, a National Instruments company". SPDX headers were also updated to latest version 3.0.
* Move all license headers to SPDX format.Martin Braun2017-12-221-12/+1
|
* utils: add set_thread_name API call, move thread_priority to threadAndrej Rode2017-06-291-4/+9
|
* uhd: tasks now use std::threads under the hood, and can't be interruptedMartin Braun2017-06-281-22/+16
| | | | | USRP1 and USRP2 used tasks that relied on Boost thread interruption mechanisms. These were replaced with explicit atomics.
* Merge branch 'maint'Martin Braun2017-05-031-2/+2
|\
| * uhd: cast thread_group.create_thread() return value to void to avoid memory leakAndrej Rode2017-04-251-2/+2
| |
* | utils: introduce new logging API and remove msg APIAndrej Rode2017-02-201-9/+9
|/
* Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width ↵Martin Braun2016-11-081-1/+1
| | | | | | | | types) - Also removes all references to boost/cstdint.hpp and replaces it with stdint.h (The 'correct' replacement would be <cstdint>, but not all of our compilers support that).
* Added missing pure virtual destructors to base classesNicholas Corgan2014-09-011-1/+5
|
* b200/dtor-stall: fixed bug that stalled b200 on shutdown.Johannes Demel2013-11-191-0/+99
|
* uhd: make spawn barrier a member of a task (see notes)Josh Blum2011-07-261-6/+8
| | | | | On OSX w/ boost 1.47, this general area of code was inconsistently barfing w/ lock error. Perhaps its a boost bug, in any case, using it this way seems to solve the problem.
* uhd: exit task on the catch-all exceptions, and dont print anythingJosh Blum2011-07-251-2/+7
|
* uhd: added tasks to simplify thread spawning use casesJosh Blum2011-07-131-0/+75