static void Main(string[] args) { myclass obj = new myclass(); obj.b = true; while (obj.notEnough()) { Thread.Sleep(5); } }