summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-10-11 15:17:09 +0800
committerGitHub <noreply@github.com>2022-10-11 09:17:09 +0200
commit5602183234f59ece4fd668915da848f0753cbbb9 (patch)
treeb955da8037206560cdc9628d94a3b604bd9ac631 /lib
parent75873715546142a6f6f78180abdf1c1ddc0416e5 (diff)
downloadNim-5602183234f59ece4fd668915da848f0753cbbb9.tar.gz
'lock levels' are deprecated, now a noop (#20539)
* 'lock levels' are deprecated, now a noop

* fixes tests
Diffstat (limited to 'lib')
-rw-r--r--lib/core/macros.nim4
-rw-r--r--lib/pure/net.nim2
-rw-r--r--lib/pure/nimprof.nim8
-rw-r--r--lib/pure/nimtracker.nim2
-rw-r--r--lib/system/cyclebreaker.nim2
-rw-r--r--lib/system/inclrtl.nim2
-rw-r--r--lib/system/memalloc.nim10
-rw-r--r--lib/system/memtracker.nim6
-rw-r--r--lib/system/profiler.nim4
-rw-r--r--lib/system/stacktraces.nim12
-rw-r--r--lib/wrappers/sqlite3.nim2
11 files changed, 27 insertions, 27 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index 595d4bab5..d09ea2fe2 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -215,12 +215,12 @@ template `or`*(x, y: NimNode): NimNode =
     y
 
 proc add*(father, child: NimNode): NimNode {.magic: "NAdd", discardable,
-  noSideEffect, locks: 0.}
+  noSideEffect.}
   ## Adds the `child` to the `father` node. Returns the
   ## father node so that calls can be nested.
 
 proc add*(father: NimNode, children: varargs[NimNode]): NimNode {.
-  magic: "NAddMultiple", discardable, noSideEffect, locks: 0.}
+  magic: "NAddMultiple", discardable, noSideEffect.}
   ## Adds each child of `children` to the `father` node.
   ## Returns the `father` node so that calls can be nested.
 
diff --git a/lib/pure/net.nim b/lib/pure/net.nim
index 16390d9af..8dd9e2c8b 100644
--- a/lib/pure/net.nim
+++ b/lib/pure/net.nim
@@ -1025,7 +1025,7 @@ proc bindAddr*(socket: Socket, port = Port(0), address = "") {.
 proc acceptAddr*(server: Socket, client: var owned(Socket), address: var string,
                  flags = {SocketFlag.SafeDisconn},
                  inheritable = defined(nimInheritHandles)) {.
-                 tags: [ReadIOEffect], gcsafe, locks: 0.} =
+                 tags: [ReadIOEffect], gcsafe.} =
   ## Blocks until a connection is being made from a client. When a connection
   ## is made sets `client` to the client socket and `address` to the address
   ## of the connecting client.
diff --git a/lib/pure/nimprof.nim b/lib/pure/nimprof.nim
index 3b1f703e3..6ee9de0a4 100644
--- a/lib/pure/nimprof.nim
+++ b/lib/pure/nimprof.nim
@@ -122,13 +122,13 @@ when defined(memProfiler):
   var
     gTicker {.threadvar.}: int
 
-  proc requestedHook(): bool {.nimcall, locks: 0.} =
+  proc requestedHook(): bool {.nimcall.} =
     if gTicker == 0:
       gTicker = SamplingInterval
       result = true
     dec gTicker
 
-  proc hook(st: StackTrace, size: int) {.nimcall, locks: 0.} =
+  proc hook(st: StackTrace, size: int) {.nimcall.} =
     when defined(ignoreAllocationSize):
       hookAux(st, 1)
     else:
@@ -140,7 +140,7 @@ else:
     gTicker: int # we use an additional counter to
                  # avoid calling 'getTicks' too frequently
 
-  proc requestedHook(): bool {.nimcall, locks: 0.} =
+  proc requestedHook(): bool {.nimcall.} =
     if interval == 0: result = true
     elif gTicker == 0:
       gTicker = 500
@@ -149,7 +149,7 @@ else:
     else:
       dec gTicker
 
-  proc hook(st: StackTrace) {.nimcall, locks: 0.} =
+  proc hook(st: StackTrace) {.nimcall.} =
     #echo "profiling! ", interval
     if interval == 0:
       hookAux(st, 1)
diff --git a/lib/pure/nimtracker.nim b/lib/pure/nimtracker.nim
index a66dfc2ea..91bb07192 100644
--- a/lib/pure/nimtracker.nim
+++ b/lib/pure/nimtracker.nim
@@ -34,7 +34,7 @@ template sbind(x: int; value) =
       quit "could not bind value"
 
 when defined(memTracker):
-  proc logEntries(log: TrackLog) {.nimcall, locks: 0, tags: [], gcsafe.} =
+  proc logEntries(log: TrackLog) {.nimcall, tags: [], gcsafe.} =
     if insertStmt.isNil:
       if prepare_v2(dbHandle, insertQuery,
           insertQuery.len, insertStmt, nil) != SQLITE_OK:
diff --git a/lib/system/cyclebreaker.nim b/lib/system/cyclebreaker.nim
index 6ec0f01f7..4427ae53b 100644
--- a/lib/system/cyclebreaker.nim
+++ b/lib/system/cyclebreaker.nim
@@ -148,7 +148,7 @@ proc thinout*[T](x: ref T) {.inline.} =
   ## and thus would keep the graph from being freed are `nil`'ed.
   ## This is a form of cycle collection that works well with Nim's ARC
   ## and its associated cost model.
-  proc getDynamicTypeInfo[T](x: T): PNimTypeV2 {.magic: "GetTypeInfoV2", noSideEffect, locks: 0.}
+  proc getDynamicTypeInfo[T](x: T): PNimTypeV2 {.magic: "GetTypeInfoV2", noSideEffect.}
 
   breakCycles(head(cast[pointer](x)), getDynamicTypeInfo(x[]))
 
diff --git a/lib/system/inclrtl.nim b/lib/system/inclrtl.nim
index ca41f39c6..42c85ad26 100644
--- a/lib/system/inclrtl.nim
+++ b/lib/system/inclrtl.nim
@@ -45,7 +45,7 @@ else:
   {.pragma: inl, inline.}
   {.pragma: compilerRtl, compilerproc.}
 
-{.pragma: benign, gcsafe, locks: 0.}
+{.pragma: benign, gcsafe.}
 
 when defined(nimHasSinkInference):
   {.push sinkInference: on.}
diff --git a/lib/system/memalloc.nim b/lib/system/memalloc.nim
index f8ebc8c5f..7660bcd58 100644
--- a/lib/system/memalloc.nim
+++ b/lib/system/memalloc.nim
@@ -1,13 +1,13 @@
 when notJSnotNims:
   proc zeroMem*(p: pointer, size: Natural) {.inline, noSideEffect,
-    tags: [], locks: 0, raises: [].}
+    tags: [], raises: [].}
     ## Overwrites the contents of the memory at `p` with the value 0.
     ##
     ## Exactly `size` bytes will be overwritten. Like any procedure
     ## dealing with raw memory this is **unsafe**.
 
   proc copyMem*(dest, source: pointer, size: Natural) {.inline, benign,
-    tags: [], locks: 0, raises: [].}
+    tags: [], raises: [].}
     ## Copies the contents from the memory at `source` to the memory
     ## at `dest`.
     ## Exactly `size` bytes will be copied. The memory
@@ -15,7 +15,7 @@ when notJSnotNims:
     ## memory this is **unsafe**.
 
   proc moveMem*(dest, source: pointer, size: Natural) {.inline, benign,
-    tags: [], locks: 0, raises: [].}
+    tags: [], raises: [].}
     ## Copies the contents from the memory at `source` to the memory
     ## at `dest`.
     ##
@@ -25,7 +25,7 @@ when notJSnotNims:
     ## dealing with raw memory this is still **unsafe**, though.
 
   proc equalMem*(a, b: pointer, size: Natural): bool {.inline, noSideEffect,
-    tags: [], locks: 0, raises: [].}
+    tags: [], raises: [].}
     ## Compares the memory blocks `a` and `b`. `size` bytes will
     ## be compared.
     ##
@@ -34,7 +34,7 @@ when notJSnotNims:
     ## **unsafe**.
 
   proc cmpMem*(a, b: pointer, size: Natural): int {.inline, noSideEffect,
-    tags: [], locks: 0, raises: [].}
+    tags: [], raises: [].}
     ## Compares the memory blocks `a` and `b`. `size` bytes will
     ## be compared.
     ##
diff --git a/lib/system/memtracker.nim b/lib/system/memtracker.nim
index f0c83f1fa..9d2d7caee 100644
--- a/lib/system/memtracker.nim
+++ b/lib/system/memtracker.nim
@@ -35,7 +35,7 @@ type
     count*: int
     disabled: bool
     data*: array[400, LogEntry]
-  TrackLogger* = proc (log: TrackLog) {.nimcall, tags: [], locks: 0, gcsafe.}
+  TrackLogger* = proc (log: TrackLog) {.nimcall, tags: [], gcsafe.}
 
 var
   gLog*: TrackLog
@@ -70,7 +70,7 @@ proc addEntry(entry: LogEntry) =
     if interesting:
       gLog.disabled = true
       cprintf("interesting %s:%ld %s\n", entry.file, entry.line, entry.op)
-      let x = cast[proc() {.nimcall, tags: [], gcsafe, locks: 0, raises: [].}](writeStackTrace)
+      let x = cast[proc() {.nimcall, tags: [], gcsafe, raises: [].}](writeStackTrace)
       x()
       quit 1
       #if gLog.count > high(gLog.data):
@@ -85,7 +85,7 @@ proc memTrackerWrite(address: pointer; size: int; file: cstring; line: int) {.co
       size: size, file: file, line: line, thread: myThreadId())
 
 proc memTrackerOp*(op: cstring; address: pointer; size: int) {.tags: [],
-         locks: 0, gcsafe.} =
+         gcsafe.} =
   addEntry LogEntry(op: op, address: address, size: size,
       file: "", line: 0, thread: myThreadId())
 
diff --git a/lib/system/profiler.nim b/lib/system/profiler.nim
index 0649f1176..e7eb6ac82 100644
--- a/lib/system/profiler.nim
+++ b/lib/system/profiler.nim
@@ -60,13 +60,13 @@ proc captureStackTrace(f: PFrame, st: var StackTrace) =
     b = b.prev
 
 var
-  profilingRequestedHook*: proc (): bool {.nimcall, locks: 0, gcsafe.}
+  profilingRequestedHook*: proc (): bool {.nimcall, gcsafe.}
     ## set this variable to provide a procedure that implements a profiler in
     ## user space. See the `nimprof` module for a reference implementation.
 
 when defined(memProfiler):
   type
-    MemProfilerHook* = proc (st: StackTrace, requestedSize: int) {.nimcall, locks: 0, gcsafe.}
+    MemProfilerHook* = proc (st: StackTrace, requestedSize: int) {.nimcall, gcsafe.}
 
   var
     profilerHook*: MemProfilerHook
diff --git a/lib/system/stacktraces.nim b/lib/system/stacktraces.nim
index 8142f8c7b..42be9d94f 100644
--- a/lib/system/stacktraces.nim
+++ b/lib/system/stacktraces.nim
@@ -22,26 +22,26 @@ when defined(nimStackTraceOverride):
       ## This is the same as the type `uintptr_t` in C.
 
     StackTraceOverrideGetTracebackProc* = proc (): string {.
-      nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.}
+      nimcall, gcsafe, raises: [], tags: [], noinline.}
     StackTraceOverrideGetProgramCountersProc* = proc (maxLength: cint): seq[cuintptr_t] {.
-      nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.}
+      nimcall, gcsafe, raises: [], tags: [], noinline.}
     StackTraceOverrideGetDebuggingInfoProc* =
       proc (programCounters: seq[cuintptr_t], maxLength: cint): seq[StackTraceEntry] {.
-        nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.}
+        nimcall, gcsafe, raises: [], tags: [], noinline.}
 
   # Default procedures (not normally used, because people opting in on this
   # override are supposed to register their own versions).
   var
     stackTraceOverrideGetTraceback: StackTraceOverrideGetTracebackProc =
-      proc (): string {.nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.} =
+      proc (): string {.nimcall, gcsafe, raises: [], tags: [], noinline.} =
         discard
         #result = "Stack trace override procedure not registered.\n"
     stackTraceOverrideGetProgramCounters: StackTraceOverrideGetProgramCountersProc =
-      proc (maxLength: cint): seq[cuintptr_t] {.nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.} =
+      proc (maxLength: cint): seq[cuintptr_t] {.nimcall, gcsafe, raises: [], tags: [], noinline.} =
         discard
     stackTraceOverrideGetDebuggingInfo: StackTraceOverrideGetDebuggingInfoProc =
       proc (programCounters: seq[cuintptr_t], maxLength: cint): seq[StackTraceEntry] {.
-        nimcall, gcsafe, locks: 0, raises: [], tags: [], noinline.} =
+        nimcall, gcsafe, raises: [], tags: [], noinline.} =
           discard
 
   # Custom procedure registration.
diff --git a/lib/wrappers/sqlite3.nim b/lib/wrappers/sqlite3.nim
index 71921c10b..96c37e09c 100644
--- a/lib/wrappers/sqlite3.nim
+++ b/lib/wrappers/sqlite3.nim
@@ -121,7 +121,7 @@ type
 
   Callback* = proc (para1: pointer, para2: int32, para3,
                      para4: cstringArray): int32{.cdecl.}
-  Tbind_destructor_func* = proc (para1: pointer){.cdecl, locks: 0, tags: [], gcsafe.}
+  Tbind_destructor_func* = proc (para1: pointer){.cdecl, tags: [], gcsafe.}
   Create_function_step_func* = proc (para1: Pcontext, para2: int32,
                                       para3: PValueArg){.cdecl.}
   Create_function_func_func* = proc (para1: Pcontext, para2: int32,