23 #ifndef VINA_PARALLEL_H
24 #define VINA_PARALLEL_H
30 #include <boost/optional.hpp>
31 #include <boost/thread/thread.hpp>
32 #include <boost/thread/mutex.hpp>
33 #include <boost/thread/condition.hpp>
36 template<
typename F,
bool Sync = false>
40 create_thread(aux(i,
this));
43 boost::mutex::scoped_lock self_lk(
self);
54 boost::mutex::scoped_lock self_lk(
self);
62 while(boost::optional<sz> sz_option =
get_size(offset)) {
63 sz s = sz_option.get();
67 boost::mutex::scoped_lock self_lk(
self);
90 boost::mutex::scoped_lock self_lk(
self);
103 create_thread(boost::ref(a));
106 boost::mutex::scoped_lock self_lk(
self);
111 while(finished <
size)
116 boost::mutex::scoped_lock self_lk(
self);
124 while(boost::optional<sz> i = get_next()) {
127 boost::mutex::scoped_lock self_lk(
self);
148 boost::mutex::scoped_lock self_lk(
self);
159 template<
typename F,
typename Container,
typename Input,
bool Sync = false>