1ba03d38ec
protect the remaining functions where necessary by a mutex lock to avoid problems in multi-threaded executions. Some functions do not require that in my opinion, and I provided an explanation in those cases.