Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msg/async:fix the incoming parameter type of EventCenter::process_events() #20607

Merged
merged 1 commit into from Feb 28, 2018

Conversation

shangfufei
Copy link

In the function of "EventCenter::process_events(int timeout_microseconds)",the type of incoming parameter is int, so change the type of EventMaxWaitUs from uint64_t to int.

Signed-off-by: shangfufei shangfufei@inspur.com

@@ -41,7 +41,7 @@ std::function<void ()> NetworkStack::add_thread(unsigned i)
char tp_name[16];
sprintf(tp_name, "msgr-worker-%u", w->id);
ceph_pthread_setname(pthread_self(), tp_name);
const uint64_t EventMaxWaitUs = 30000000;
const int EventMaxWaitUs = 30000000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead, i think we should change EventCenter::process_events(int timeout_microseconds, ceph::timespan *working_dur) to EventCenter::process_events(unsigned timeout_microseconds, ceph::timespan *working_dur) . as the only reason we need an int timeout_microseconds is that std::chrono::microseconds::rep is a signed integer, but here, what we want is but a timeout, which will never be less than zero.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's ok, it would look better.

…) to EventCenter::process_events(unsigned timeout_microseconds)

Signed-off-by: shangfufei <shangfufei@inspur.com>
@shangfufei shangfufei changed the title msg/async/Stack:change the type of EventMaxWaitUs from uint64_t to int msg/async: change EventCenter::process_events(int timeout_microseconds) to EventCenter::process_events(unsigned timeout_microseconds) Feb 27, 2018
@shangfufei shangfufei changed the title msg/async: change EventCenter::process_events(int timeout_microseconds) to EventCenter::process_events(unsigned timeout_microseconds) msg/async:fix the incoming parameter type of EventCenter::process_events() Feb 28, 2018
@tchaikov tchaikov merged commit 8c4f10c into ceph:master Feb 28, 2018
@shangfufei shangfufei deleted the test_stack branch March 10, 2018 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants