danicoin/contrib/otshell_utils/lib_common1.hpp
rfree2monero ae2a50659f 2014 network limit 1.2 +utils +toc -doc -drmonero
new update of the pr with network limits

more debug options:
discarding downloaded blocks all or after given height.
trying to trigger the locking errors.

debug levels polished/tuned to sane values.
debug/logging improved.

warning: this pr should be correct code, but it could make
an existing (in master version) locking error appear more often.

it's a race on the list (map) of peers, e.g. between closing/deleting
them versus working on them in net-limit sleep in sending chunk.

the bug is not in this code/this pr, but in the master version.

the locking problem of master will be fixed in other pr.

problem is ub, and in practice is seems to usually cause program abort
(tested on debian stable with updated gcc). see --help for option
to add sleep to trigger the error faster.
2015-02-20 22:28:03 +01:00

52 lines
1.1 KiB
C++

/* See other files here for the LICENCE that applies here. */
#ifndef INCLUDE_OT_NEWCLI_COMMON1
#define INCLUDE_OT_NEWCLI_COMMON1
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <list>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <iterator>
#include <stdexcept>
#include <functional>
#include <memory>
#include <thread>
#include <atomic>
#include <mutex>
// list of thigs from libraries that we pull into namespace nOT::nNewcli
// we might still need to copy/paste it in few places to make IDEs pick it up correctly
#define INJECT_OT_COMMON_USING_NAMESPACE_COMMON_1 \
using std::string; \
using std::vector; \
using std::vector; \
using std::list; \
using std::set; \
using std::map; \
using std::ostream; \
using std::istream; \
using std::cin; \
using std::cerr; \
using std::cout; \
using std::cerr; \
using std::endl; \
using std::function; \
using std::unique_ptr; \
using std::shared_ptr; \
using std::weak_ptr; \
using std::enable_shared_from_this; \
using std::mutex; \
using std::lock_guard; \
#endif