The new GDKLib Builder produces code that utilizes the same thread safety code that the Core DBP functions use.All plugins compiled by third-parties that utilised GDKLib Builder.exe should recompile using the new version to ensure that all functions are built properly.
Here is an example of how it works:
Code: Select all
PrototypeC ProtodbPhyUpdate()
ProcedureDLL dbPhyUpdate()
Static Ptr
;/ Synchronous mutex lock is done here in GDKLoadPtr
If Not GDKLoadPtr(@Ptr,"DarkPhysics.dll","?dbPhyUpdate@@YAXXZ")
ProcedureReturn 0
EndIf
If Not GDKDebuggerPresent()
Function.ProtodbPhyUpdate=Ptr
Function()
GDKCheckRuntimeError()
GDKCleanupFunctionCall()
ProcedureReturn 0
EndIf
GDKMsgLong(Ptr, #Null)
GDKCheckRuntimeError()
;/ Mutex lock is released here
GDKCleanupFunctionCall()
EndProcedure