@@ -276,7 +276,7 @@ in (atomicPtrIsProperlyAligned(here), "Argument `here` is not properly aligned")
276
276
* Returns:
277
277
* true if the store occurred, false if not.
278
278
*/
279
- bool cas (T,V1 ,V2 )(T* here, V1 ifThis, V2 writeThis) pure nothrow @nogc @trusted
279
+ bool cas (MemoryOrder succ = MemoryOrder.seq,MemoryOrder fail = MemoryOrder.seq, T,V1 ,V2 )(T* here, V1 ifThis, V2 writeThis) pure nothrow @nogc @trusted
280
280
if (! is (T == shared S, S) && is (T : V1 ))
281
281
in (atomicPtrIsProperlyAligned(here), " Argument `here` is not properly aligned" )
282
282
{
@@ -287,14 +287,14 @@ in (atomicPtrIsProperlyAligned(here), "Argument `here` is not properly aligned")
287
287
static if (__traits(isFloating, T))
288
288
{
289
289
alias IntTy = IntForFloat! T;
290
- return atomicCompareExchangeStrongNoResult (cast (IntTy* )here, * cast (IntTy* )&arg1, * cast (IntTy* )&arg2);
290
+ return atomicCompareExchangeStrongNoResult! (succ, fail) (cast (IntTy* )here, * cast (IntTy* )&arg1, * cast (IntTy* )&arg2);
291
291
}
292
292
else
293
- return atomicCompareExchangeStrongNoResult (here, arg1, arg2);
293
+ return atomicCompareExchangeStrongNoResult! (succ, fail) (here, arg1, arg2);
294
294
}
295
295
296
296
// / Ditto
297
- bool cas (T,V1 ,V2 )(shared (T)* here, V1 ifThis, V2 writeThis) pure nothrow @nogc @trusted
297
+ bool cas (MemoryOrder succ = MemoryOrder.seq,MemoryOrder fail = MemoryOrder.seq, T,V1 ,V2 )(shared (T)* here, V1 ifThis, V2 writeThis) pure nothrow @nogc @trusted
298
298
if (! is (T == class ) && (is (T : V1 ) || is (shared T : V1 )))
299
299
in (atomicPtrIsProperlyAligned(here), " Argument `here` is not properly aligned" )
300
300
{
@@ -310,15 +310,15 @@ in (atomicPtrIsProperlyAligned(here), "Argument `here` is not properly aligned")
310
310
static assert (! hasUnsharedIndirections! V2 , " Copying `" ~ V2 .stringof ~ " * writeThis` to `" ~ shared (T).stringof ~ " * here` would violate shared." );
311
311
alias Thunk2 = V2 ;
312
312
}
313
- return cas (cast (T* )here, * cast (Thunk1* )&ifThis, * cast (Thunk2* )&writeThis);
313
+ return cas! (succ, fail) (cast (T* )here, * cast (Thunk1* )&ifThis, * cast (Thunk2* )&writeThis);
314
314
}
315
315
316
316
// / Ditto
317
- bool cas (T,V1 ,V2 )(shared (T)* here, shared (V1 ) ifThis, shared (V2 ) writeThis) pure nothrow @nogc @trusted
317
+ bool cas (MemoryOrder succ = MemoryOrder.seq,MemoryOrder fail = MemoryOrder.seq, T,V1 ,V2 )(shared (T)* here, shared (V1 ) ifThis, shared (V2 ) writeThis) pure nothrow @nogc @trusted
318
318
if (is (T == class ))
319
319
in (atomicPtrIsProperlyAligned(here), " Argument `here` is not properly aligned" )
320
320
{
321
- return atomicCompareExchangeStrongNoResult (cast (T* )here, cast (V1 )ifThis, cast (V2 )writeThis);
321
+ return atomicCompareExchangeStrongNoResult! (succ, fail) (cast (T* )here, cast (V1 )ifThis, cast (V2 )writeThis);
322
322
}
323
323
324
324
/**
@@ -335,7 +335,7 @@ in (atomicPtrIsProperlyAligned(here), "Argument `here` is not properly aligned")
335
335
* Returns:
336
336
* true if the store occurred, false if not.
337
337
*/
338
- bool cas (T,V)(T* here, T* ifThis, V writeThis) pure nothrow @nogc @trusted
338
+ bool cas (MemoryOrder succ = MemoryOrder.seq,MemoryOrder fail = MemoryOrder.seq, T,V)(T* here, T* ifThis, V writeThis) pure nothrow @nogc @trusted
339
339
if (! is (T == shared S, S) && ! is (V == shared U, U))
340
340
in (atomicPtrIsProperlyAligned(here), " Argument `here` is not properly aligned" )
341
341
{
@@ -345,14 +345,14 @@ in (atomicPtrIsProperlyAligned(here), "Argument `here` is not properly aligned")
345
345
static if (__traits(isFloating, T))
346
346
{
347
347
alias IntTy = IntForFloat! T;
348
- return atomicCompareExchangeStrong (cast (IntTy* )here, cast (IntTy* )ifThis, * cast (IntTy* )&writeThis);
348
+ return atomicCompareExchangeStrong! (succ, fail) (cast (IntTy* )here, cast (IntTy* )ifThis, * cast (IntTy* )&writeThis);
349
349
}
350
350
else
351
- return atomicCompareExchangeStrong (here, ifThis, writeThis);
351
+ return atomicCompareExchangeStrong! (succ, fail) (here, ifThis, writeThis);
352
352
}
353
353
354
354
// / Ditto
355
- bool cas (T,V1 ,V2 )(shared (T)* here, V1 * ifThis, V2 writeThis) pure nothrow @nogc @trusted
355
+ bool cas (MemoryOrder succ = MemoryOrder.seq,MemoryOrder fail = MemoryOrder.seq, T,V1 ,V2 )(shared (T)* here, V1 * ifThis, V2 writeThis) pure nothrow @nogc @trusted
356
356
if (! is (T == class ) && (is (T : V1 ) || is (shared T : V1 )))
357
357
in (atomicPtrIsProperlyAligned(here), " Argument `here` is not properly aligned" )
358
358
{
@@ -373,15 +373,15 @@ in (atomicPtrIsProperlyAligned(here), "Argument `here` is not properly aligned")
373
373
alias Thunk2 = V2 ;
374
374
}
375
375
static assert (is (T : Thunk1), " Mismatching types for `here` and `ifThis`: `" ~ shared (T).stringof ~ " ` and `" ~ V1 .stringof ~ " `." );
376
- return cas (cast (T* )here, cast (Thunk1* )ifThis, * cast (Thunk2* )&writeThis);
376
+ return cas! (succ, fail) (cast (T* )here, cast (Thunk1* )ifThis, * cast (Thunk2* )&writeThis);
377
377
}
378
378
379
379
// / Ditto
380
- bool cas (T,V)(shared (T)* here, shared (T)* ifThis, shared (V) writeThis) pure nothrow @nogc @trusted
380
+ bool cas (MemoryOrder succ = MemoryOrder.seq,MemoryOrder fail = MemoryOrder.seq, T,V)(shared (T)* here, shared (T)* ifThis, shared (V) writeThis) pure nothrow @nogc @trusted
381
381
if (is (T == class ))
382
382
in (atomicPtrIsProperlyAligned(here), " Argument `here` is not properly aligned" )
383
383
{
384
- return atomicCompareExchangeStrong (cast (T* )here, cast (T* )ifThis, cast (V)writeThis);
384
+ return atomicCompareExchangeStrong! (succ, fail) (cast (T* )here, cast (T* )ifThis, cast (V)writeThis);
385
385
}
386
386
387
387
/**
0 commit comments