On 2013-04-08 09:46, eles wrote:
That kind of genericity will be just wonderful in some cases. For
example, one could make sure, at compilation, that interrupt code does
not call sleeping code when it comes to Linux kernel programming.
I wonder, however, if one could re-define the notions of green/red
several times in a project. Maybe per-module basis?
Of course. If I recall correctly you just annotate a type or similar:
struct ThreadSafe (T)
{
T t;
}
void bar (ThreadSafe!(Foo) foo) { )
Now "bar" will only accept a thread safe "Foo".
--
/Jacob Carlborg