Fix some compilation warnings and expose tracker names. (#376)

* Fix asyncsync compilation warnings.

* Fix tracker names should be public.
This commit is contained in:
Eugene Kabanov 2023-04-08 19:34:57 +03:00 committed by GitHub
parent ab5a8c2e0f
commit e05d2f8e96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

View File

@ -154,7 +154,10 @@ proc wakeUpFirst(lock: AsyncLock): bool {.inline.} =
res = true
break
if i > 0:
lock.waiters.delete(0, i - 1)
when compiles(lock.waiters.delete(0 .. (i - 1))):
lock.waiters.delete(0 .. (i - 1))
else:
lock.waiters.delete(0, i - 1)
res
proc checkAll(lock: AsyncLock): bool {.inline.} =
@ -272,7 +275,10 @@ proc wakeupNext(waiters: var seq[Future[void]]) {.inline.} =
break
if i > 0:
waiters.delete(0, i - 1)
when compiles(waiters.delete(0 .. (i - 1))):
waiters.delete(0 .. (i - 1))
else:
waiters.delete(0, i - 1)
proc full*[T](aq: AsyncQueue[T]): bool {.inline.} =
## Return ``true`` if there are ``maxsize`` items in the queue.

View File

@ -61,7 +61,7 @@ type
closed*: int64
const
DgramTransportTrackerName = "datagram.transport"
DgramTransportTrackerName* = "datagram.transport"
proc remoteAddress*(transp: DatagramTransport): TransportAddress {.
raises: [Defect, TransportOsError].} =

View File

@ -71,8 +71,8 @@ type
gcsafe, raises: [Defect].}
const
StreamTransportTrackerName = "stream.transport"
StreamServerTrackerName = "stream.server"
StreamTransportTrackerName* = "stream.transport"
StreamServerTrackerName* = "stream.server"
when defined(windows):
type