styleCheck: Fix some inconsistent identifiers (#16177)
This commit is contained in:
parent
29c9a1c14b
commit
297c8e403d
20 changed files with 64 additions and 64 deletions
|
|
@ -54,7 +54,7 @@ proc signal(cv: var Semaphore) =
|
|||
const CacheLineSize = 32 # true for most archs
|
||||
|
||||
type
|
||||
Barrier {.compilerProc.} = object
|
||||
Barrier {.compilerproc.} = object
|
||||
entered: int
|
||||
cv: Semaphore # Semaphore takes 3 words at least
|
||||
when sizeof(int) < 8:
|
||||
|
|
@ -63,26 +63,26 @@ type
|
|||
cacheAlign2: array[CacheLineSize-sizeof(int), byte]
|
||||
interest: bool # whether the master is interested in the "all done" event
|
||||
|
||||
proc barrierEnter(b: ptr Barrier) {.compilerProc, inline.} =
|
||||
proc barrierEnter(b: ptr Barrier) {.compilerproc, inline.} =
|
||||
# due to the signaling between threads, it is ensured we are the only
|
||||
# one with access to 'entered' so we don't need 'atomicInc' here:
|
||||
inc b.entered
|
||||
# also we need no 'fence' instructions here as soon 'nimArgsPassingDone'
|
||||
# will be called which already will perform a fence for us.
|
||||
|
||||
proc barrierLeave(b: ptr Barrier) {.compilerProc, inline.} =
|
||||
proc barrierLeave(b: ptr Barrier) {.compilerproc, inline.} =
|
||||
atomicInc b.left
|
||||
when not defined(x86): fence()
|
||||
# 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.} =
|
||||
proc openBarrier(b: ptr Barrier) {.compilerproc, inline.} =
|
||||
b.entered = 0
|
||||
b.left = 0
|
||||
b.interest = false
|
||||
|
||||
proc closeBarrier(b: ptr Barrier) {.compilerProc.} =
|
||||
proc closeBarrier(b: ptr Barrier) {.compilerproc.} =
|
||||
fence()
|
||||
if b.left != b.entered:
|
||||
b.cv.initSemaphore()
|
||||
|
|
@ -114,7 +114,7 @@ type
|
|||
FlowVarObj[T] = object of FlowVarBaseObj
|
||||
blob: T
|
||||
|
||||
FlowVar*{.compilerProc.}[T] = ref FlowVarObj[T] ## A data flow variable.
|
||||
FlowVar*{.compilerproc.}[T] = ref FlowVarObj[T] ## A data flow variable.
|
||||
|
||||
ToFreeQueue = object
|
||||
len: int
|
||||
|
|
@ -212,14 +212,14 @@ proc `=destroy`[T](fv: var FlowVarObj[T]) =
|
|||
finished(fv)
|
||||
`=destroy`(fv.blob)
|
||||
|
||||
proc nimCreateFlowVar[T](): FlowVar[T] {.compilerProc.} =
|
||||
proc nimCreateFlowVar[T](): FlowVar[T] {.compilerproc.} =
|
||||
new(result)
|
||||
|
||||
proc nimFlowVarCreateSemaphore(fv: FlowVarBase) {.compilerProc.} =
|
||||
proc nimFlowVarCreateSemaphore(fv: FlowVarBase) {.compilerproc.} =
|
||||
fv.cv.initSemaphore()
|
||||
fv.usesSemaphore = true
|
||||
|
||||
proc nimFlowVarSignal(fv: FlowVarBase) {.compilerProc.} =
|
||||
proc nimFlowVarSignal(fv: FlowVarBase) {.compilerproc.} =
|
||||
if fv.ai != nil:
|
||||
acquire(fv.ai.cv.L)
|
||||
fv.ai.idx = fv.idx
|
||||
|
|
@ -305,7 +305,7 @@ proc isReady*(fv: FlowVarBase): bool =
|
|||
else:
|
||||
result = true
|
||||
|
||||
proc nimArgsPassingDone(p: pointer) {.compilerProc.} =
|
||||
proc nimArgsPassingDone(p: pointer) {.compilerproc.} =
|
||||
let w = cast[ptr Worker](p)
|
||||
signal(w.taskStarted)
|
||||
|
||||
|
|
@ -489,7 +489,7 @@ var
|
|||
|
||||
initLock stateLock
|
||||
|
||||
proc nimSpawn3(fn: WorkerProc; data: pointer) {.compilerProc.} =
|
||||
proc nimSpawn3(fn: WorkerProc; data: pointer) {.compilerproc.} =
|
||||
# implementation of 'spawn' that is used by the code generator.
|
||||
while true:
|
||||
if selectWorker(readyWorker, fn, data): return
|
||||
|
|
@ -574,7 +574,7 @@ var
|
|||
|
||||
initLock distinguishedLock
|
||||
|
||||
proc nimSpawn4(fn: WorkerProc; data: pointer; id: ThreadId) {.compilerProc.} =
|
||||
proc nimSpawn4(fn: WorkerProc; data: pointer; id: ThreadId) {.compilerproc.} =
|
||||
acquire(distinguishedLock)
|
||||
if not distinguishedData[id].initialized:
|
||||
activateDistinguishedThread(id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue