Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use per extension C-API locks and setup blacklist mechanism
This allows for using a per extension C-API lock instead of a global lock. Each time an extension entry point is loaded (the Init_ function), we setup a new lock index. We store this in the native method frame so any methods defined will pick up the lock index. This lock index is then stored for the native method and used when locking around a C extension call. We use the value of 0 to indicate an extension doesn't need locking if -Xcapi.lock is not enabled. If -Xcapi.lock is enabled, each extension gets it's own lock through this mechanism. Except for this general strategy, we also have a blacklist which contains known bad extensions that always need a lock around them. A known example of this is NKF, which tracks all it's internal state in global C variables. The blacklist mechanism allows for an easy way to add more troublesome extensions without having to enabled the C-API lock for everything.
- Loading branch information
Showing
8 changed files
with
105 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters