8231387: java.security.Provider.getService returns random result due to race condition with mutating methods in the same class

Synchronize access to legacyMap in Provider.getService.

Reviewed-by: valeriep
2 files changed