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

Remove blocking dbus calls #209

Merged
merged 19 commits into from Aug 28, 2014
Merged

Remove blocking dbus calls #209

merged 19 commits into from Aug 28, 2014

Conversation

spiiroin
Copy link
Contributor

No description provided.

If something like this is needed later on, it must be re-implemented
without using dbus_send_with_block().
This is needed if the pending call needs to be cancelled.
The semi procedural logic is replaced by stacked state machines
that should ensure that mce is never blocked if sensord gets stuck
for some reason.

Externally the interface provided by mce-sensorfw does not change.

[mce] Rewrite mce-sensorfw module so that it does not use blocking dbus calls. Fixes JB#17747
The sysinfod service is provided by proprietary Nokia component
and the compatibility has already been disabled for almost two
years.

Since get_sysinfo_value() was the last place within mce itself
to use blocking dbus method calls, dropping support altogether
allows removal of blocking dbus call helpers too.
Future MCE code should never use blocking dbus ipc and thus the
helper for making them is removed.
Can be turned in to a png file with dot from graphviz package:
  dot -Tpng mce-sensorfw.dot -o mce-sensorfw.png
Legacy way of dealing with asynchronous dbus method calls in mce was to
a) leave one extra ref to pending call when issuing the method call
b) call dbus_pending_call_unref() from handler callback
Which is problematic since (b) does not happen if the pending call is
canceled.

Now the extra reference is cleared after it is no longer needed and
calls to dbus_pending_call_unref() from all related handler callbacks
are removed.
These were accidentally left in after testing.
Leftovers from testing and evolving logic.
Used to just clear the pointer, which created a memory leak.
Makes valgrind output less noisy.
Makes valgrind output less noisy.
Makes valgrind output less noisy.
Makes valgrind output less noisy.
The dbus_send_with_block() helper must not be used anymore.

Handle query asynchronously.
@@ -43,6 +43,6 @@ void mce_sensorfw_orient_disable(void);

# ifdef __cplusplus
};
#endif
# endif
Copy link

Choose a reason for hiding this comment

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

Why space here and on the ifdef __cpluplus above after # that is?

Copy link
Contributor

Choose a reason for hiding this comment

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

Syntactical rules is that the # must be at column 0, but it's nice to indicate nesting. Since there's already an outer preprocessor block, my guess is that the space indicates that it's nested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is there just to make nesting levels easier to see.

In this case the c++ bracked had confused auto-indent in my editor way back in time and the # indentation was not done for the whole header.

spiiroin added a commit that referenced this pull request Aug 28, 2014
@spiiroin spiiroin merged commit fb13c1e into nemomobile:master Aug 28, 2014
@spiiroin spiiroin deleted the remove_blocking_dbus_calls branch August 28, 2014 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants