【发布时间】:2022-06-30 19:05:16
【问题描述】:
我一直在尝试编写一个基于称为POOL 的可锁定队列(在本例中为seq)的数据库连接池。我想将POOL 作为全局变量,然后使用initConnectionPool 对其进行实例化。我尝试使用下面的代码这样做
var POOL: ConnectionPool
proc initConnectionPool*(initialPoolSize: static int) =
POOL = ConnectionPool(connections: @[])
initLock(POOL.lock)
但是,这会引发编译器错误:
‘pthread_mutex_t {aka union <anonymous>}’ has no member named ‘abi’
我不太确定这应该是什么意思或如何处理。我该如何解决这个问题?
【问题讨论】:
-
幸运的是,我无法在 macOS 上使用 nim v1.6.2 重现这一点。
-
@hola 好点。以上来自 Ubuntu 18.04.6 LTS 上的 nim v1.6.2(git hash as per nim -v: 9084d9bc02bcd983b81a4c76a05f27b9ce2707dd)