* training: implemented multi thread driven by the main thread.
* Ely: first attempt to integrate multithread.
Merge branch 'master' into multithread
* training: modified threads conditions.
* Ely: first attempt of multithread implementation: should use mutex to
change variables.
* Ely: multithread first attempt completed. It hangs when closing.
* Ely: first implementation of multithrading based on condition
variables completed. 

* It seems to work. TODO perform more tests and then merge into master
branch.