This function is used to set the thread local variables (serverTL) for * arbitrary module threads. All incoming module threads share the same set of * thread local variables (modulethreadvar). * * This is needed as some KeyDB functions use thread local variables to do things, * and we don't want to share the thread local variables of existing server threads */
| 615 | * This is needed as some KeyDB functions use thread local variables to do things, |
| 616 | * and we don't want to share the thread local variables of existing server threads */ |
| 617 | void moduleSetThreadVariablesIfNeeded(void) { |
| 618 | if (serverTL == nullptr) { |
| 619 | serverTL = &g_pserver->modulethreadvar; |
| 620 | g_fModuleThread = true; |
| 621 | } |
| 622 | } |
| 623 | |
| 624 | /* -------------------------------------------------------------------------- |
| 625 | * Service API exported to modules |
no outgoing calls
no test coverage detected