Thank you for opening a pull request and contributing to AsciidoctorJ!
Please take a bit of time giving some details about your pull request:
Kind of change
[x] Bug fix
[ ] New non-breaking feature
[ ] New breaking feature
[ ] Documentation update
[ ] Build improvement
Description
What is the goal of this pull request?
Fix the issue reported in https://github.com/asciidoctor/asciidoctorj/issues/1158.
When converting to a stream a new RubyClass is created lazily.
This step is not protected with a mutex, so that JRuby can fail.
This PR wants to fix this so that this exception does not occur when converting documents in parallel with one Asciidoctor instance.
How does it achieve that?
Eagerly create the class when initializing the Asciidoctor instance.
Are there any alternative ways to implement this?
Yes, the class could be created lazily and a mutex could guarantee mutual exclusion so that the class is created only once.
Are there any implications of this pull request? Anything a user must know?
Issue
Fixes #1157
Release notes
Please add a corresponding entry to the file CHANGELOG.adoc
…en converting to stream.
Thank you for opening a pull request and contributing to AsciidoctorJ!
Please take a bit of time giving some details about your pull request:
Kind of change
Description
What is the goal of this pull request?
Fix the issue reported in https://github.com/asciidoctor/asciidoctorj/issues/1158. When converting to a stream a new RubyClass is created lazily. This step is not protected with a mutex, so that JRuby can fail. This PR wants to fix this so that this exception does not occur when converting documents in parallel with one Asciidoctor instance.
How does it achieve that?
Eagerly create the class when initializing the Asciidoctor instance.
Are there any alternative ways to implement this?
Yes, the class could be created lazily and a mutex could guarantee mutual exclusion so that the class is created only once.
Are there any implications of this pull request? Anything a user must know?
Issue
Fixes #1157
Release notes
Please add a corresponding entry to the file CHANGELOG.adoc