… | |
… | |
171 | static void |
171 | static void |
172 | perl_multicore_nop (void) |
172 | perl_multicore_nop (void) |
173 | { |
173 | { |
174 | } |
174 | } |
175 | |
175 | |
|
|
176 | static const char perl_multicore_api_key[] = "perl_multicore_api"; |
|
|
177 | |
176 | /* this is the initial implementation of "release" - it initialises */ |
178 | /* this is the initial implementation of "release" - it initialises */ |
177 | /* the api and then calls the real release function */ |
179 | /* the api and then calls the real release function */ |
178 | static void |
180 | static void |
179 | perl_multicore_init (void) |
181 | perl_multicore_init (void) |
180 | { |
182 | { |
181 | dTHX; |
183 | dTHX; |
182 | |
184 | |
183 | /* check for existing API struct in PL_modglobal */ |
185 | /* check for existing API struct in PL_modglobal */ |
184 | SV **api_svp = hv_fetch (PL_modglobal, "perl_multicore_api", sizeof ("perl_multicore_api") - 1, 1); |
186 | SV **api_svp = hv_fetch (PL_modglobal, perl_multicore_api_key, |
|
|
187 | sizeof (perl_multicore_api_key) - 1, 1); |
185 | |
188 | |
186 | if (SvPOKp (*api_svp)) |
189 | if (SvPOKp (*api_svp)) |
187 | perl_multicore_api = (struct perl_multicore_api *)SvPVX (*api_svp); /* we have one, use the existing one */ |
190 | perl_multicore_api = (struct perl_multicore_api *)SvPVX (*api_svp); /* we have one, use the existing one */ |
188 | else |
191 | else |
189 | { |
192 | { |