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:
@@ -858,7 +858,7 @@ autoprewarm_dump_now(PG_FUNCTION_ARGS)
|
||||
}
|
||||
|
||||
static void
|
||||
apw_init_state(void *ptr)
|
||||
apw_init_state(void *ptr, void *arg)
|
||||
{
|
||||
AutoPrewarmSharedState *state = (AutoPrewarmSharedState *) ptr;
|
||||
|
||||
@@ -880,7 +880,7 @@ apw_init_shmem(void)
|
||||
apw_state = GetNamedDSMSegment("autoprewarm",
|
||||
sizeof(AutoPrewarmSharedState),
|
||||
apw_init_state,
|
||||
&found);
|
||||
&found, NULL);
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user