1. A method comprising: monitoring each of a plurality of accesses by a multithreaded program to shared data structures stored within a database, the accesses being implemented by varying application programming interface (API) methods; determining, based on pre-defined synchronization safeguards, whether each of the accesses is valid or invalid based on the utilized corresponding API method; allowing those accesses to the shared data structures that were determined to be valid to proceed; and preventing those accesses to the shared data structures that were determined to be invalid from proceeding.