Combine ModuleInit and GetModuleObject
The two functions can be combined into one as both are called only once. This removes the need for the explicit ModuleInit function.
This commit is contained in:
@ -607,17 +607,6 @@ bool check_shard_status(ROUTER_INSTANCE* router, char* shard)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The module initialisation routine, called when the module
|
||||
* is first loaded.
|
||||
*/
|
||||
void ModuleInit()
|
||||
{
|
||||
MXS_NOTICE("Initializing Schema Sharding Router.");
|
||||
spinlock_init(&instlock);
|
||||
instances = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* The module entry point routine. It is this routine that
|
||||
* must populate the structure that is referred to as the
|
||||
@ -628,6 +617,9 @@ void ModuleInit()
|
||||
*/
|
||||
ROUTER_OBJECT* GetModuleObject()
|
||||
{
|
||||
MXS_NOTICE("Initializing Schema Sharding Router.");
|
||||
spinlock_init(&instlock);
|
||||
instances = NULL;
|
||||
return &MyObject;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user