|
38 | 38 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
39 | 39 | * SOFTWARE.
|
40 | 40 | */
|
| 41 | +// skip GIL |
41 | 42 | package com.oracle.graal.python.builtins.objects.cext.capi;
|
42 | 43 |
|
43 |
| -import com.oracle.graal.python.runtime.GilNode; |
44 | 44 | import com.oracle.truffle.api.CompilerDirectives;
|
45 |
| -import com.oracle.truffle.api.dsl.Bind; |
46 |
| -import com.oracle.truffle.api.dsl.Cached; |
47 |
| -import com.oracle.truffle.api.dsl.Cached.Exclusive; |
48 | 45 | import com.oracle.truffle.api.interop.InteropLibrary;
|
49 | 46 | import com.oracle.truffle.api.interop.TruffleObject;
|
50 | 47 | import com.oracle.truffle.api.interop.UnsupportedMessageException;
|
@@ -77,13 +74,8 @@ boolean isPointer() {
|
77 | 74 |
|
78 | 75 | @ExportMessage(limit = "1")
|
79 | 76 | long asPointer(
|
80 |
| - @CachedLibrary("this.getPtr()") InteropLibrary ptrInteropLib, @Exclusive @Cached GilNode gil) throws UnsupportedMessageException { |
81 |
| - boolean mustRelease = gil.acquire(); |
82 |
| - try { |
83 |
| - return ptrInteropLib.asPointer(getPtr()); |
84 |
| - } finally { |
85 |
| - gil.release(mustRelease); |
86 |
| - } |
| 77 | + @CachedLibrary("this.getPtr()") InteropLibrary ptrInteropLib) throws UnsupportedMessageException { |
| 78 | + return ptrInteropLib.asPointer(getPtr()); |
87 | 79 | }
|
88 | 80 |
|
89 | 81 | @ExportMessage
|
@@ -111,14 +103,8 @@ int identityHashCode(@CachedLibrary("this.getPtr()") InteropLibrary lib) throws
|
111 | 103 |
|
112 | 104 | @ExportMessage(limit = "1")
|
113 | 105 | boolean isIdentical(Object other, InteropLibrary otherLib,
|
114 |
| - @Exclusive @Cached GilNode gil, |
115 |
| - @Bind("gil.acquire()") boolean mustRelease, |
116 | 106 | @CachedLibrary("this.getPtr()") InteropLibrary lib) {
|
117 |
| - try { |
118 |
| - return lib.isIdentical(ptr, other, otherLib); |
119 |
| - } finally { |
120 |
| - gil.release(mustRelease); |
121 |
| - } |
| 107 | + return lib.isIdentical(ptr, other, otherLib); |
122 | 108 | }
|
123 | 109 |
|
124 | 110 | @SuppressWarnings({"unused", "static-method"})
|
|
0 commit comments