mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 02:15:45 +02:00
fix: access to wrong thread local after command migrates fiber to a different thread (#2410)
* fix: access to wrong thread local after command migrates fiber to a different thread
This commit is contained in:
parent
1fb3c74933
commit
c8871896d7
5 changed files with 42 additions and 34 deletions
|
@ -181,4 +181,13 @@ void ServerState::ReturnInterpreter(Interpreter* ir) {
|
|||
interpreter_mgr_.Return(ir);
|
||||
}
|
||||
|
||||
ServerState* ServerState::SafeTLocal() {
|
||||
// https://stackoverflow.com/a/75622732
|
||||
asm volatile("");
|
||||
return state_;
|
||||
}
|
||||
|
||||
bool ServerState::ShouldLogSlowCmd(unsigned latency_usec) const {
|
||||
return slow_log_shard_.IsEnabled() && latency_usec >= log_slower_than_usec;
|
||||
}
|
||||
} // end of namespace dfly
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue