mirror of
https://github.com/postgres/postgres.git
synced 2025-12-19 17:02:53 +03:00
Allow passing a pointer to GetNamedDSMSegment()'s init callback.
This commit adds a new "void *arg" parameter to GetNamedDSMSegment() that is passed to the initialization callback function. This is useful for reusing an initialization callback function for multiple DSM segments. Author: Zsolt Parragi <zsolt.parragi@percona.com> Reviewed-by: Sami Imseih <samimseih@gmail.com> Discussion: https://postgr.es/m/CAN4CZFMjh8TrT9ZhWgjVTzBDkYZi2a84BnZ8bM%2BfLPuq7Cirzg%40mail.gmail.com
This commit is contained in:
@@ -115,7 +115,7 @@ static shmem_startup_hook_type prev_shmem_startup_hook = NULL;
|
||||
* when initializing dynamically with a DSM or when loading the module.
|
||||
*/
|
||||
static void
|
||||
injection_point_init_state(void *ptr)
|
||||
injection_point_init_state(void *ptr, void *arg)
|
||||
{
|
||||
InjectionPointSharedState *state = (InjectionPointSharedState *) ptr;
|
||||
|
||||
@@ -159,7 +159,7 @@ injection_shmem_startup(void)
|
||||
* First time through, so initialize. This is shared with the dynamic
|
||||
* initialization using a DSM.
|
||||
*/
|
||||
injection_point_init_state(inj_state);
|
||||
injection_point_init_state(inj_state, NULL);
|
||||
}
|
||||
|
||||
LWLockRelease(AddinShmemInitLock);
|
||||
@@ -179,7 +179,7 @@ injection_init_shmem(void)
|
||||
inj_state = GetNamedDSMSegment("injection_points",
|
||||
sizeof(InjectionPointSharedState),
|
||||
injection_point_init_state,
|
||||
&found);
|
||||
&found, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user