mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 22:43:27 +02:00
Implement async dispatcher #221
This commit is contained in:
@@ -29,25 +29,42 @@
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/recursive_mutex.hpp>
|
||||
#include <boost/thread/locks.hpp>
|
||||
#include <boost/thread/future.hpp>
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
namespace std {
|
||||
using boost::thread;
|
||||
using boost::thread;
|
||||
using boost::future;
|
||||
using boost::future_status;
|
||||
using boost::promise;
|
||||
|
||||
using boost::mutex;
|
||||
using boost::timed_mutex;
|
||||
using boost::recursive_mutex;
|
||||
using boost::recursive_timed_mutex;
|
||||
using boost::mutex;
|
||||
using boost::timed_mutex;
|
||||
using boost::recursive_mutex;
|
||||
using boost::recursive_timed_mutex;
|
||||
|
||||
using boost::lock_guard;
|
||||
using boost::unique_lock;
|
||||
using boost::lock_guard;
|
||||
using boost::unique_lock;
|
||||
|
||||
using boost::condition_variable;
|
||||
using boost::condition_variable_any;
|
||||
using boost::condition_variable;
|
||||
using boost::condition_variable_any;
|
||||
|
||||
template<typename R>
|
||||
bool is_ready(std::future<R>& f)
|
||||
{ return f.wait_for(boost::chrono::seconds(0)) == future_status::ready; }
|
||||
}
|
||||
|
||||
#else
|
||||
#include <thread>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <future>
|
||||
|
||||
namespace std {
|
||||
template<typename R>
|
||||
bool is_ready(std::future<R>& f)
|
||||
{ return f.wait_for(chrono::seconds(0)) == future_status::ready; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user