mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-25 21:54:28 +08:00
mdbx: add mdbx_fastmutex_t.
This commit is contained in:
@@ -68,6 +68,7 @@ typedef struct {
|
||||
HANDLE mutex;
|
||||
HANDLE event;
|
||||
} mdbx_condmutex_t;
|
||||
typedef CRITICAL_SECTION mdbx_fastmutex_t;
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#include <sys/file.h>
|
||||
@@ -85,6 +86,7 @@ typedef struct {
|
||||
pthread_mutex_t mutex;
|
||||
pthread_cond_t cond;
|
||||
} mdbx_condmutex_t;
|
||||
typedef pthread_mutex_t mdbx_fastmutex_t;
|
||||
#endif /* Platform */
|
||||
|
||||
#ifndef SSIZE_MAX
|
||||
@@ -395,6 +397,11 @@ int mdbx_condmutex_signal(mdbx_condmutex_t *condmutex);
|
||||
int mdbx_condmutex_wait(mdbx_condmutex_t *condmutex);
|
||||
int mdbx_condmutex_destroy(mdbx_condmutex_t *condmutex);
|
||||
|
||||
int mdbx_fastmutex_init(mdbx_fastmutex_t *fastmutex);
|
||||
int mdbx_fastmutex_acquire(mdbx_fastmutex_t *fastmutex);
|
||||
int mdbx_fastmutex_release(mdbx_fastmutex_t *fastmutex);
|
||||
int mdbx_fastmutex_destroy(mdbx_fastmutex_t *fastmutex);
|
||||
|
||||
int mdbx_pwritev(mdbx_filehandle_t fd, struct iovec *iov, int iovcnt,
|
||||
off_t offset, size_t expected_written);
|
||||
int mdbx_pread(mdbx_filehandle_t fd, void *buf, size_t count, off_t offset);
|
||||
|
Reference in New Issue
Block a user