Xcos MVC: use std::atomic to be thread safe 00/17500/2
authorClément DAVID <clement.david@scilab-enterprises.com>
Mon, 23 Nov 2015 13:36:25 +0000 (14:36 +0100)
committerPaul Bignier <paul.bignier@scilab-enterprises.com>
Fri, 27 Nov 2015 08:10:58 +0000 (09:10 +0100)
commit375f8fe4ef97a8d5b8595f4f8983c46923a7cb2c
treeaf623ef430aaee94b6c2ab0c76f40d8a3f0c6885
parentff502e61fe6b1a2b74763fa46ebf7681983da4eb
Xcos MVC: use std::atomic to be thread safe

Xcos use both the Scilab execution thread, the EDT and the Finalizer Thread
to create / access / delete MVC objects. This commit manage this thread
safety using spin-locks implemented as std::atomic_flag (fast on the more
common threadsafe case).

Change-Id: Ic6ea51276de2a38e1530de6f08d138d4a04047e0
scilab/modules/scicos/includes/Controller.hxx
scilab/modules/scicos/src/cpp/Controller.cpp