--- /dev/null
+#include <iostream>\r
+#include <boost/thread.hpp>\r
+#include <boost/date_time.hpp>\r
+#include "Runnable.h"\r
+\r
+\r
+using std::cout;\r
+using std::endl;\r
+\r
+using boost::thread;\r
+using boost::ref;\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |* Declaration *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |* Imported *|\r
+ \*-------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |* Public *|\r
+ \*-------------------------------------*/\r
+\r
+void helloThread_Objet(void);\r
+\r
+/*--------------------------------------*\\r
+ |* Private *|\r
+ \*-------------------------------------*/\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |* Implementation *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |* Public *|\r
+ \*-------------------------------------*/\r
+\r
+void helloThread_Objet(void)\r
+ {\r
+ int x = 10;\r
+ int y = 100;\r
+ Runnable runnable(x, y);\r
+\r
+ cout << "\nthread : objet : start" << endl;\r
+\r
+ // A very important consideration when using functors with boost threads is that the thread constructor takes the functor parameter by value !!\r
+ // boost::thread threadRunnable(runnable);\r
+\r
+ // Solution: Here runnable is passed by reference (not a copy)\r
+ thread threadRunnable(ref(runnable)); // use foncteur runnable() of Runnable\r
+\r
+ cout << "Waiting for thread ..." << endl;\r
+\r
+ threadRunnable.join();\r
+ cout << "[outside thread] : " << x << " + " << y << " = " << runnable.getResult() << endl; // give bad result if runnable is passed by value to boost::thread\r
+\r
+ cout << "thread : objet : end" << endl;\r
+ }\r
+\r
+/*--------------------------------------*\\r
+ |* Private *|\r
+ \*-------------------------------------*/\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |* End *|\r
+ \*---------------------------------------------------------------------*/\r
+\r