darconeous/smcp — pull request #13 by libcg (2014-06-06 13:52:35+00:00)
Title: Make the library thread-safe. DO NOT MERGE.

I noticed that, when using one smcp_t instance per thread, the library would crash when observing two resources at the same time using two threads.

Using smcp_get_current_instance() within the whole library is broken because it is sometimes returning NULL... I got rid of smcp_set_current_instance() and smcp_get_current_instance(), and modified a lot of prototypes, passing smcp_t instances all around. Crashes are gone!

However:
- Only the library has been modified. smcpd, smcpctl and other things need to be corrected.
- Stack optimizations for SMCP_EMBEDDED are now disabled.

I don't have so much time to deal with that, so I'm just leaving this here so you can cherry-pick my work and build upon it ;)