diff --git a/src/fastlock.cpp b/src/fastlock.cpp index 4f8b2e6dc..49c0fb095 100644 --- a/src/fastlock.cpp +++ b/src/fastlock.cpp @@ -299,7 +299,7 @@ extern "C" void fastlock_lock(struct fastlock *lock) #if defined(__i386__) || defined(__amd64__) __asm__ __volatile__ ("pause"); -#elif defined(__arm__) +#elif defined(__aarch64__) __asm__ __volatile__ ("yield"); #endif if ((++cloops % 0x100000) == 0) @@ -335,7 +335,7 @@ extern "C" int fastlock_trylock(struct fastlock *lock, int fWeak) struct ticket ticket_expect { { { active, active } } }; struct ticket ticket_setiflocked { { { active, next } } }; - if (__atomic_compare_exchange(&lock->m_ticket, &ticket_expect, &ticket_setiflocked, fWeak /*weak*/, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) + if (__atomic_compare_exchange(&lock->m_ticket.u, &ticket_expect.u, &ticket_setiflocked.u, fWeak /*weak*/, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) { lock->m_depth = 1; tid = gettid(); diff --git a/src/replication.cpp b/src/replication.cpp index 3823bc43f..832432653 100644 --- a/src/replication.cpp +++ b/src/replication.cpp @@ -279,7 +279,7 @@ void replicationFeedSlave(client *replica, int dictid, robj **argv, int argc, bo if (g_pserver->repl_backlog && fSendRaw) feedReplicationBacklogWithObject(selectcmd); /* Send it to slaves */ - addReply(replica,selectcmd); + addReplyAsync(replica,selectcmd); if (dictid < 0 || dictid >= PROTO_SHARED_SELECT_CMDS) decrRefCount(selectcmd); @@ -291,12 +291,12 @@ void replicationFeedSlave(client *replica, int dictid, robj **argv, int argc, bo * or are already in sync with the master. */ /* Add the multi bulk length. */ - addReplyArrayLen(replica,argc); + addReplyArrayLenAsync(replica,argc); /* Finally any additional argument that was not stored inside the * static buffer if any (from j to argc). */ for (int j = 0; j < argc; j++) - addReplyBulk(replica,argv[j]); + addReplyBulkAsync(replica,argv[j]); } /* Propagate write commands to slaves, and populate the replication backlog diff --git a/src/server.cpp b/src/server.cpp index b7e845e20..c385787eb 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -5242,10 +5242,6 @@ int main(int argc, char **argv) { dictSetHashFunctionSeed(hashseed); g_pserver->sentinel_mode = checkForSentinelMode(argc,argv); initServerConfig(); - for (int iel = 0; iel < MAX_EVENT_LOOPS; ++iel) - { - initServerThread(g_pserver->rgthreadvar+iel, iel == IDX_EVENT_LOOP_MAIN); - } serverTL = &g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN]; aeAcquireLock(); // We own the lock on boot @@ -5373,6 +5369,10 @@ int main(int argc, char **argv) { int background = cserver.daemonize && !cserver.supervised; if (background) daemonize(); + for (int iel = 0; iel < MAX_EVENT_LOOPS; ++iel) + { + initServerThread(g_pserver->rgthreadvar+iel, iel == IDX_EVENT_LOOP_MAIN); + } initServer(); initNetworking(cserver.cthreads > 1 /* fReusePort */);