diff --git a/Aufgabe3/ConsoleApplication1/Buffer.cs b/Aufgabe3/ConsoleApplication1/Buffer.cs index a7375fdb10af4499196ea5a59209254a8e546181..816b685867f4c557f4efc472a3d624aede3567c3 100644 --- a/Aufgabe3/ConsoleApplication1/Buffer.cs +++ b/Aufgabe3/ConsoleApplication1/Buffer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading; @@ -20,7 +20,7 @@ namespace ConsoleApplication1 { if (carQueue.Count == size) { - throw new Exception("Buffer voll"); + throw new Exception("Buffer full"); } @@ -31,7 +31,7 @@ namespace ConsoleApplication1 { if (carQueue.Count == 0) { - throw new Exception("Buffer leer"); + throw new Exception("Buffer empty"); } return carQueue.Dequeue(); @@ -65,4 +65,4 @@ namespace ConsoleApplication1 } -} \ No newline at end of file +} diff --git a/Aufgabe3/ConsoleApplication1/Car.cs b/Aufgabe3/ConsoleApplication1/Car.cs index ad88c15900976a7c7f3761b6b00870ef5edb399f..f7aa24860cc3f1e37f4298237f6d9cf5b70e6a00 100644 --- a/Aufgabe3/ConsoleApplication1/Car.cs +++ b/Aufgabe3/ConsoleApplication1/Car.cs @@ -1,4 +1,4 @@ - + using System; @@ -17,7 +17,7 @@ namespace ConsoleApplication1 { thisCarId = carId; carId++; - Console.WriteLine("auto erstellt " + thisCarId); + Console.WriteLine("car created. id = " + thisCarId); } public void count() diff --git a/Aufgabe3/ConsoleApplication1/Consumer.cs b/Aufgabe3/ConsoleApplication1/Consumer.cs index 613781b5dcd6ead0d3314a06563ae2c261105dfd..4b10acddf2194927523318b1d756db145416de59 100644 --- a/Aufgabe3/ConsoleApplication1/Consumer.cs +++ b/Aufgabe3/ConsoleApplication1/Consumer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Runtime.CompilerServices; using System.Threading; @@ -29,7 +29,7 @@ namespace ConsoleApplication1 if (wakeConsumersUp) { - Console.WriteLine("consumer wurde aufgeweckt"); + Console.WriteLine("consumer was woken up"); isAsleep = false; } } @@ -47,7 +47,7 @@ namespace ConsoleApplication1 if (!b.empty()) { Car c = b.pop(); - Console.WriteLine("Auto ausgeparkt " + c.getThisCarId()); + Console.WriteLine("car pulled out of parking space. car id = " + c.getThisCarId()); } else { @@ -60,27 +60,10 @@ namespace ConsoleApplication1 } } } -/* - private void sleep() - { - while (isAsleep) - { - Console.WriteLine("asleep..."); - Thread.Sleep(50); - - - if (wakeConsumersUp) - { - Console.WriteLine("wurde aufgeweckt"); - isAsleep = false; - } - } - } -*/ public static void wakeUp() { wakeConsumersUp = true; } } -} \ No newline at end of file +} diff --git a/Aufgabe3/ConsoleApplication1/Producer.cs b/Aufgabe3/ConsoleApplication1/Producer.cs index 6bfb3f6a7ddaf5d27ead6a7b38ef1c19f68a439f..dbb11500b3e0f95ad15330edb96e364cf43e96ac 100644 --- a/Aufgabe3/ConsoleApplication1/Producer.cs +++ b/Aufgabe3/ConsoleApplication1/Producer.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Threading; namespace ConsoleApplication1 @@ -31,7 +31,7 @@ namespace ConsoleApplication1 if (wakeProducersUp) { - Console.WriteLine("producer wurde aufgeweckt"); + Console.WriteLine("producer was woken up"); isAsleep = false; } } @@ -71,4 +71,4 @@ namespace ConsoleApplication1 } } -} \ No newline at end of file +}