Files for previous commit

main
Inga 🏳‍🌈 13 years ago
parent 4b68db1e2e
commit 84fb0e41bd
  1. 25
      Web.Core/Counter.cs
  2. 15
      Web.Core/ILogger.cs

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Web.Core {
public class Counter {
private int value;
private readonly object locker = new object();
public Counter() {
this.value = 0;
}
public int GetCurrentValueAndIncrement() {
lock(this.locker) {
int result = this.value;
this.value++;
return result;
}
}
}
}

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Web.Core {
public interface ILogger {
/// <summary>
/// </summary>
/// <param name="message">Single-line message</param>
void Log(string message);
}
}
Loading…
Cancel
Save