I have Vendor.DLL (a native DLL written in C ++) that provides many methods. Usually, Vendor.DLL opens its own Vendor files, returns descriptors, and allows more read / write operations for these files. Vendor.DLL supports multithreading (when called from unmanaged code / COM).
If I expose the Pinvoked method from the Vendor DLL, let's say
PinvokedVendor.DLL
[System.Runtime.InteropServices.DllImportAttribute("Vendor.dll", EntryPoint = "SomeVendorMethod")]
public static extern int SomeVendorMethod(uint param1, ref SomeVendorDataStruct pData);
How to ensure that this wrapper class is thread safe? Is it even thread safe when called from ASP.NET? What are my options?
Thanks in advance.
source
share