Threading done - note segmentation fault on exit