bugfix: 'set' overloadable; further steps for multi threading support
This commit is contained in:
parent
170573a87f
commit
99bcc233cd
34 changed files with 934 additions and 459 deletions
|
|
@ -22,14 +22,14 @@ else:
|
|||
inc(p, val)
|
||||
result = p
|
||||
|
||||
proc atomicInc(memLoc: var int, x: int): int =
|
||||
proc atomicInc(memLoc: var int, x: int = 1): int =
|
||||
when hasThreadSupport:
|
||||
result = sync_add_and_fetch(memLoc, x)
|
||||
else:
|
||||
inc(memLoc, x)
|
||||
result = memLoc
|
||||
|
||||
proc atomicDec(memLoc: var int, x: int): int =
|
||||
proc atomicDec(memLoc: var int, x: int = 1): int =
|
||||
when hasThreadSupport:
|
||||
when defined(sync_sub_and_fetch):
|
||||
result = sync_sub_and_fetch(memLoc, x)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue