diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2023-08-03 10:37:12 +0200 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2023-08-03 10:37:12 +0200 |
commit | d9a54c3f6cbf068a1e1553eac9adcf9127b007f5 (patch) | |
tree | e7e8cb1beda5ae9ba83a53d0cea4a29379b6e6a6 /pool.h | |
parent | 6d6365d782a713d7fde48daa70e64e64ac283001 (diff) | |
download | pgfuse-d9a54c3f6cbf068a1e1553eac9adcf9127b007f5.tar.gz pgfuse-d9a54c3f6cbf068a1e1553eac9adcf9127b007f5.tar.bz2 |
fixing for platforms, where pthread_t is not numeric (as for musl, where it is a pointer,
POSIX sadly did away with the requirement that pthread_t must be a numeric):
- printing thread ids as pointers with '%p' instead of converting them to unsigned int and
printing them with '%u'
- using separate 'avail' and 'thread' arrays in pools to record status of pooled database
connections
Diffstat (limited to 'pool.h')
-rw-r--r-- | pool.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -27,7 +27,8 @@ typedef struct PgConnPool { PGconn **conns; /* array of connections */ size_t size; /* max number of connections */ - pthread_t *avail; /* slots of allocated/available connections per thread */ + unsigned int *avail; /* status of slots */ + pthread_t *thread; /* slots of allocated/available connections per thread */ pthread_mutex_t lock; /* monitor lock */ pthread_cond_t cond; /* condition signalling a free connection */ } PgConnPool; |