First serious multi-threading thread-safe version.
Not tested for linux. Requires pthread.