-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLive2.cs
More file actions
29 lines (26 loc) · 672 Bytes
/
Copy pathLive2.cs
File metadata and controls
29 lines (26 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
namespace CSharp13;
using System.Threading;
class DEMOLive2: ISample
{
ref partial struct MyFile
{
public partial void Dispose(); //OLD partial methods!
}
//generated
ref partial struct MyFile
{
Span<byte> map;
object mapLock = new();
public Span<byte> Map
{
get { lock (mapLock) { return map; } }
private set { lock (mapLock) { map = value; } }
}
public partial void Dispose() => Map = default; //OLD partial method implementation!
public MyFile() { }
}
public void Run()
{
Console.WriteLine("LOCK OBJECT + partial evreywhere");
}
}