doh sorry, there is already a pthread for this.