blob: c57e5364bf83303865d1c2263a288e1600a5cb63 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
using System;
using System.Threading;
class Impl<T> where T : class
{
public static object CompareExchangeImpl (TypedReference tr, object value, object comparand)
{
return Interlocked.CompareExchange (ref __refvalue(tr, T), (T) value, (T) comparand);
}
}
class X
{
public static void Main ()
{
var obj = "obj";
var tr = __makeref (obj);
Impl<string>.CompareExchangeImpl (tr, "foo", null);
}
}
|