[SERVICE] initial import of pthread code from the prototype