Developer documentation
Version 3.0.3-105-gd3941f44
thread.h File Reference
#include <thread>
#include <future>
#include <mutex>
#include "debug.h"
#include "mrtrix.h"
#include "exception.h"

Go to the source code of this file.

Classes

class  MR::Thread::__Backend
 

Namespaces

namespace  MR
 
namespace  MR::Thread
 

Enumerations

enum class  MR::Thread::nthreads_t { MR::Thread::nthreads_t::UNINITIALISED , MR::Thread::nthreads_t::EXPLICIT , MR::Thread::nthreads_t::IMPLICIT }
 

Functions

size_t MR::Thread::number_of_threads ()
 
nthreads_t MR::Thread::type_nthreads ()
 
size_t MR::Thread::threads_to_execute ()
 
template<class Functor >
__Multi< typename std::remove_reference< Functor >::type > MR::Thread::multi (Functor &&functor, size_t nthreads=threads_to_execute())
 used to request multiple threads of the corresponding functor More...
 
template<class Functor >
__run< Functor >::type MR::Thread::run (Functor &&functor, const std::string &name="unnamed")
 Execute the functor's execute method in a separate thread. More...
 

Variable Documentation

◆ functor

std::remove_reference<Functor>::type& functor

Definition at line 215 of file thread.h.

◆ functors

vector<typename std::remove_reference<Functor>::type> functors
protected

Definition at line 202 of file thread.h.

◆ name

const std::string name
protected

Definition at line 108 of file thread.h.

◆ num

size_t num

Definition at line 216 of file thread.h.

◆ thread

std::future<void> thread
protected

Definition at line 143 of file thread.h.

◆ threads

vector<std::future<void> > threads
protected

Definition at line 201 of file thread.h.