[DllImport("kernel32.dll", SetLastError=true)]
private static extern IntPtr CreateSemaphore(ref SECURITY_ATTRIBUTES securityAttributes, int initialCount, int maximumCount, string name);
[DllImport("kernel32.dll", SetLastError=true)]
private static extern IntPtr CreateSemaphore(
IntPtr lpSemaphoreAttributes,
int lInitialCount,
int lMaximumCount,
string lpName);
None.
None.
Remember to specify an appropriate name prefix.
See SECURITY_ATTRIBUTES for a sample of creating a semaphore with a NULL DACL.
System.Threading.CreateSemaphore system.threading.semaphore on MSDN
