Added "threadlocal" patch name to version. Note that this code has now been tested and it works :-)