mirror of
https://github.com/sogou/workflow.git
synced 2026-02-08 01:33:17 +08:00
Remove the usage of std::random_device. (#1288)
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
Wang Zhulei (wangzhulei@sogou-inc.com)
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#include <algorithm>
|
||||
#include <random>
|
||||
@@ -29,7 +30,7 @@ class EndpointGroup
|
||||
public:
|
||||
EndpointGroup(int group_id, UPSGroupPolicy *policy) :
|
||||
mutex(PTHREAD_MUTEX_INITIALIZER),
|
||||
gen(rd())
|
||||
gen(random())
|
||||
{
|
||||
this->id = group_id;
|
||||
this->policy = policy;
|
||||
@@ -45,7 +46,6 @@ public:
|
||||
UPSGroupPolicy *policy;
|
||||
struct rb_node rb;
|
||||
pthread_mutex_t mutex;
|
||||
std::random_device rd;
|
||||
std::mt19937 gen;
|
||||
std::vector<EndpointAddress *> mains;
|
||||
std::vector<EndpointAddress *> backups;
|
||||
|
||||
Reference in New Issue
Block a user