잠금1 [C#][Study][기초다지기] lock 문 lock 문 - 현재 thread에서 프로그램을 실행하는동안 다른 thread의 개체를 잠그고, 진행되던 thread의 실행이 끝난 뒤에 개체의 잠금이 해제되어 다음 thread를 실행할 수 있게 함 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Lock_Statement { class Program { public void printname() { Console.WriteLine("My name is Steven Clark"); } static void Main(string[] args) { Program p = new Program(); lock (p) // lock 구문 생성.. 2023. 9. 23. 이전 1 다음