mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-28 13:55:14 +00:00
minor improvement to the barrier implementation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#
|
||||
#
|
||||
# The Nimrod Compiler
|
||||
# The Nim Compiler
|
||||
# (c) Copyright 2012 Andreas Rumpf
|
||||
#
|
||||
# See the file "copying.txt", included in this
|
||||
|
||||
@@ -65,7 +65,9 @@ proc barrierEnter(b: ptr Barrier) {.compilerProc, inline.} =
|
||||
proc barrierLeave(b: ptr Barrier) {.compilerProc, inline.} =
|
||||
atomicInc b.left
|
||||
when not defined(x86): fence()
|
||||
if b.interest and b.left == b.entered: signal(b.cv)
|
||||
# We may not have seen the final value of b.entered yet,
|
||||
# so we need to check for >= instead of ==.
|
||||
if b.interest and b.left >= b.entered: signal(b.cv)
|
||||
|
||||
proc openBarrier(b: ptr Barrier) {.compilerProc, inline.} =
|
||||
b.entered = 0
|
||||
|
||||
5
todo.txt
5
todo.txt
@@ -3,7 +3,10 @@ version 0.10
|
||||
|
||||
Repetition renders the ridiculous reasonable.
|
||||
|
||||
- introduce ``--experimental`` switch
|
||||
- document 'converter'
|
||||
- document the tables module better
|
||||
|
||||
|
||||
- c2nim depends on the compiler
|
||||
- make nimble part of the distribution
|
||||
- split idetools into separate tool
|
||||
|
||||
Reference in New Issue
Block a user