01org/media-service-upnp — pull request #175 by rmerlino (2013-01-17 13:17:23+00:00)
Title: Re-Arch: Merge task and chain task - Phase 2

Partial fix for issue #162

In this PR I am focusing on simplifying internal APIs and stuctures.

There is *no change* in the global existing algorithms.
Even though there are a lot of small changes, this should not introduce any instability.
I made some unit testing after each step by step commit.

* The task processor should not have to deal with a cancellable because this info is duplicated in the msu_async_cb_data_t struct and only the latest should be used.
* I added an access to the queue "user data" in the various callbacks, this could be useful in the future
* The task processor changes in the first and the last commit, so only the final result is relevant
* I merged 2 structs into a single one: msu_task_t and msu_async_cb_data_t because this makes sense and simplifies a lot the internal APIs. msu_async_cb_data is actually a 'derived' msu_task (with additional members to manage the async call context)
* After the merge I was able to remove a lot of function parameters
* The merge removed duplicate fields (type, result)

There is still room for enhancements, not included here, but not sure this really worth it because this would require changes in the existing algorithms:
* Simplify the call sequence when completing / cancelling a client task
* Make the task delete() and cancel() functions 'virtual'. i.e. function pointers in the msu_task_t struct

NB: The dbus abstraction as described in issue #162 is not part of this PR