The current implementation based on locks can deadlock in the child process if fork and any of the time functions are called concurrently in a multi-threaded process. This is not a bug in glibc because POSIX makes this behavior undefined, but it would be convenient to support this as an extension. A solution for bug 16145 cold probably help here as well.