First step toward a thread safe polylib: