Commit aa786f0b authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

refs #5206 fix mutex initializer to be compatible with osx

git-svn-id: file:///svn/toku/tokudb@45964 c7de825b-a66e-492c-adef-691d508d4ae1
parent 30458099
...@@ -166,7 +166,7 @@ toku_txn_create_txn ( ...@@ -166,7 +166,7 @@ toku_txn_create_txn (
.xa_xid = {0}, .xa_xid = {0},
.progress_poll_fun = NULL, .progress_poll_fun = NULL,
.progress_poll_fun_extra = NULL, .progress_poll_fun_extra = NULL,
.txn_lock = {{{0}}}, .txn_lock = ZERO_MUTEX_INITIALIZER,
.open_fts = open_fts, .open_fts = open_fts,
.roll_info = roll_info, .roll_info = roll_info,
.state = TOKUTXN_LIVE, .state = TOKUTXN_LIVE,
......
...@@ -35,6 +35,12 @@ typedef struct toku_mutex { ...@@ -35,6 +35,12 @@ typedef struct toku_mutex {
#endif #endif
} toku_mutex_t; } toku_mutex_t;
#if defined(__APPLE__)
static const toku_mutex_t ZERO_MUTEX_INITIALIZER = {{0}};
#else
static const toku_mutex_t ZERO_MUTEX_INITIALIZER = {{{0}}};
#endif
static inline void static inline void
toku_mutex_init(toku_mutex_t *mutex, const toku_pthread_mutexattr_t *attr) { toku_mutex_init(toku_mutex_t *mutex, const toku_pthread_mutexattr_t *attr) {
int r = pthread_mutex_init(&mutex->pmutex, attr); int r = pthread_mutex_init(&mutex->pmutex, attr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment