added Ueb04 Csharp

and fixed problems
main
Jonas Arnold 4 years ago
parent 15f8aa1d6b
commit b680d18bee
  1. 6
      ADIS_Csharp/ADIS_Csharp.sln
  2. 4
      ADIS_Csharp/Sync-Ueb04-NestedMonitor/BlackHole.cs
  3. 2
      ADIS_Csharp/Sync-Ueb04-NestedMonitor/NotifyingQueue.cs

@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sync-Ueb02-Latch", "Sync-Ue
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sync-Ueb03-WaitPool", "Sync-Ueb03-WaitPool\Sync-Ueb03-WaitPool.csproj", "{6041729C-8528-49A7-B335-1720B46DEFD1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sync-Ueb04-NestedMonitor", "Sync-Ueb04-NestedMonitor\Sync-Ueb04-NestedMonitor.csproj", "{839AB456-68F3-4ABC-A0EE-95F08FEFC033}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -33,6 +35,10 @@ Global
{6041729C-8528-49A7-B335-1720B46DEFD1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6041729C-8528-49A7-B335-1720B46DEFD1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6041729C-8528-49A7-B335-1720B46DEFD1}.Release|Any CPU.Build.0 = Release|Any CPU
{839AB456-68F3-4ABC-A0EE-95F08FEFC033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{839AB456-68F3-4ABC-A0EE-95F08FEFC033}.Debug|Any CPU.Build.0 = Debug|Any CPU
{839AB456-68F3-4ABC-A0EE-95F08FEFC033}.Release|Any CPU.ActiveCfg = Release|Any CPU
{839AB456-68F3-4ABC-A0EE-95F08FEFC033}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -7,14 +7,10 @@ namespace Sync_Ueb04_NestedMonitor
private NotifyingQueue<String> queue = new NotifyingQueue<String>();
public void Put(String thing) {
lock (this) {
queue.Enqueue(thing);
}
}
public String Get() {
lock (this) {
return queue.Dequeue();
}
}
}
}

@ -20,7 +20,7 @@ namespace Sync_Ueb04_NestedMonitor
public T Dequeue() {
lock (this) {
if (head == tail) {
while (head == tail) {
Monitor.Wait(this);
}
tail++;

Loading…
Cancel
Save