[fix] mac os x includes std::random...
This commit is contained in:
parent
162c993262
commit
44f423477a
|
@ -34,6 +34,9 @@
|
||||||
#include "levin_base.h"
|
#include "levin_base.h"
|
||||||
#include "misc_language.h"
|
#include "misc_language.h"
|
||||||
|
|
||||||
|
#include <random>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
|
|
||||||
namespace epee
|
namespace epee
|
||||||
{
|
{
|
||||||
|
@ -684,6 +687,7 @@ void async_protocol_handler_config<t_connection_context>::del_out_connections(si
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// close random out connections
|
// close random out connections
|
||||||
|
// TODO or better just keep removing random elements (performance)
|
||||||
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
|
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
|
||||||
shuffle(out_connections.begin(), out_connections.end(), std::default_random_engine(seed));
|
shuffle(out_connections.begin(), out_connections.end(), std::default_random_engine(seed));
|
||||||
while (count > 0 && out_connections.size() > 0)
|
while (count > 0 && out_connections.size() > 0)
|
||||||
|
|
Loading…
Reference in New Issue