Thread.c encapsulated