dart-sdk/tests/ffi_2
Martin Kustermann f9eb97fdff Reland "[vm] Expose Dart_{CurrentIsolate,ExitIsolate,EnterIsolate}"
For applications that want to have arbitrary number of isolates call
into native code that may be blocking, we expose the API functions that
allows those native threads to exit an isolate before running
long/blocking code.

Without the ability to exit/re-enter isolate, one may experience
deadlocks as we have a fixed limit on the number of concurrently
executing isolates atm.

In the longer term we may find a way to do this automatically
with low overhead, see [0]. But since those API functions are quite
stable and we already expose e.g. `Dart_{Enter,Exit}Scope`, I don't
see a reason not to expose `Dart_{Enter,Exit}Isolate`.

Difference to original CL:

  Do use STL synchronization primitives (as the ones in runtime/bin
  are not always available in shared libraries)


[0] Issue https://github.com/dart-lang/sdk/issues/51261

Issue https://github.com/dart-lang/sdk/issues/51254

TEST=ffi{,_2}/dl_api_exit_enter_isolate_test

Change-Id: Id817e8d4edb3db35f029248d62388cbd0682001d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/294980
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-04-13 09:20:17 +00:00
..
abi_specific_int_incomplete_aot_test.dart [vm/ffi] ABI-specific integers 2021-12-16 22:07:00 +00:00
abi_specific_int_incomplete_jit_test.dart [vm/ffi] Ensure there's a single Function object per ffi-callback + exceptional-return combination 2022-12-07 20:47:13 +00:00
abi_specific_int_test.dart Reland "[vm/ffi] Add common C types" 2022-01-27 13:09:01 +00:00
abi_test.dart [vm/ffi] Introduce Abi 2021-12-01 19:19:37 +00:00
aliasing_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
all_positive.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
allocator_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
analysis_options.yaml
bool_test.dart [vm/ffi] Add Bool 2021-10-18 10:44:11 +00:00
c_types_test.dart [vm/ffi] Add Char C type 2022-03-28 09:46:56 +00:00
callback_tests_utils.dart [VM/FFI] Adds FFI leaf calls. 2021-05-21 11:12:02 +00:00
calloc_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
coordinate.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
data_not_asan_test.dart [deps] Roll package:ffi to 2.0.1 2022-06-19 18:29:11 +00:00
data_test.dart [vm/ffi] Stop reifying type argument in Pointer 2022-11-28 09:45:45 +00:00
dl_api_exit_enter_isolate_test.dart Reland "[vm] Expose Dart_{CurrentIsolate,ExitIsolate,EnterIsolate}" 2023-04-13 09:20:17 +00:00
dylib_isolates_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
dylib_utils.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
expando_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
extension_methods_test.dart [ffi] Add .ref= setter for pointers of structs or unions 2022-01-12 20:48:28 +00:00
external_typed_data_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
ffi_2.status [test] Introduce status variable $simulator, and fix some cases missing simarm_x64. 2023-04-04 03:10:26 +00:00
ffi_callback_unique_test.dart [vm/ffi] Ensure there's a single Function object per ffi-callback + exceptional-return combination 2022-12-07 20:47:13 +00:00
ffi_test_helpers.dart [vm] Implement NativeFinalizer 2022-03-26 09:41:21 +00:00
finalizer_external_size_accounting_test.dart [vm, gc] Add missing promotion of Finalizer external size. Remove race incrementing external size. 2022-11-30 17:14:59 +00:00
function_callbacks_many_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
function_callbacks_structs_by_value_generated_test.dart Spelling runtime bin 2023-01-06 07:48:22 +00:00
function_callbacks_structs_by_value_test.dart Spelling tools 2023-01-09 15:48:57 +00:00
function_callbacks_test.dart [vm] Support serialization of FFI callbacks in IL serialization 2022-08-26 17:37:21 +00:00
function_callbacks_very_many_test.dart [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
function_structs_by_value_generated_args_leaf_test.dart [ffi/tests] Split large auto-generated tests into multiple tests 2022-10-20 22:08:53 +00:00
function_structs_by_value_generated_args_test.dart [ffi/tests] Split large auto-generated tests into multiple tests 2022-10-20 22:08:53 +00:00
function_structs_by_value_generated_compounds.dart Reland "[vm/ffi] Add common C types" 2022-01-27 13:09:01 +00:00
function_structs_by_value_generated_ret_arg_leaf_test.dart [ffi/tests] Split large auto-generated tests into multiple tests 2022-10-20 22:08:53 +00:00
function_structs_by_value_generated_ret_arg_test.dart [ffi/tests] Split large auto-generated tests into multiple tests 2022-10-20 22:08:53 +00:00
function_structs_by_value_generated_ret_leaf_test.dart Spelling runtime bin 2023-01-06 07:48:22 +00:00
function_structs_by_value_generated_ret_test.dart Spelling runtime bin 2023-01-06 07:48:22 +00:00
function_structs_test.dart Fixed various typos in a lot of files 2022-07-25 12:21:59 +00:00
function_test.dart [vm/ffi] Adds param number in trampoline null error 2021-09-04 07:22:03 +00:00
function_very_many_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
hardfp_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
has_symbol_test.dart [vm/ffi] Support DynamicLibrary.process() on Windows 2022-09-27 08:42:03 +00:00
inline_array_multi_dimensional_test.dart [test/ffi] Split generated files on isLeaf 2021-10-14 13:05:33 +00:00
inline_array_test.dart [test/ffi] Split generated files on isLeaf 2021-10-14 13:05:33 +00:00
native_effect_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
negative_function_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
null_regress_39068_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
null_test.dart [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
prepare_flutter_bundle.dart [misc] Cleanup stale todos 2022-06-28 16:02:53 +00:00
regress_37254_test.dart [vm/ffi] Stop reifying type argument in Pointer 2022-11-28 09:45:45 +00:00
regress_39044_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_39063_test.dart [test/ffi] Fix errors in tests 2021-09-28 13:17:01 +00:00
regress_39885_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_40537_test.dart Fixed various typos in a lot of files 2022-07-25 12:21:59 +00:00
regress_43016_test.dart [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
regress_43693_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_44985_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_44986_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45189_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45198_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45507_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_45988_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_46004_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_46085_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_46127_test.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00
regress_47594_test.dart [test] Avoid tests fighting over the default service port. 2022-11-10 17:28:48 +00:00
regress_47673_2_test.dart [cfe/ffi] Handle invalid types in Array 2021-11-19 13:38:47 +00:00
regress_47673_test.dart [cfe/ffi] Handle invalid types in Array 2021-11-19 13:38:47 +00:00
regress_49402_test.dart [vm/ffi] Fix constant Finalizables 2022-07-07 08:39:21 +00:00
regress_51315_test.dart [vm/ffi] Fix MemoryCopyInstr on ia32 2023-02-14 13:20:43 +00:00
regress_b_261224444_test.dart [test/ffi] Free pointer allocated via malloc 2022-12-13 16:41:47 +00:00
regress_flutter79441_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress_flutter97301_test.dart [vm/test] Fix memory leak in ffi/regress_flutter97301_test 2022-02-03 00:28:55 +00:00
regress_jump_to_frame_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
sizeof_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
snapshot_test.dart [vm/concurrency] Remove --(no-)enable-isolate-groups flag usage in tests 2021-11-04 18:57:21 +00:00
stacktrace_regress_37910_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
structs_nested_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
structs_packed_test.dart [test/ffi] Split generated files on isLeaf 2021-10-14 13:05:33 +00:00
structs_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
unaligned_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
variance_function_test.dart [vm/ffi] Stop reifying type argument in Pointer 2022-11-28 09:45:45 +00:00
very_large_struct.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_dynamic_library_test.dart [vm/ffi] Support DynamicLibrary.process() on Windows 2022-09-27 08:42:03 +00:00
vmspecific_enable_ffi_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_function_callbacks_exit_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_function_callbacks_negative_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_function_callbacks_test.dart [vm/concurrency] Remove --(no-)enable-isolate-groups flag usage in tests 2021-11-04 18:57:21 +00:00
vmspecific_function_gc_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_function_test.dart [test/ffi] Fix errors in tests 2021-09-28 13:17:01 +00:00
vmspecific_handle_dynamically_linked_test.dart [vm] Fix Dart_CObject_Type breaking change 2023-02-20 11:59:19 +00:00
vmspecific_handle_test.dart Reland "[vm/ffi] Throw on returning Error in Handle" 2022-10-03 12:25:08 +00:00
vmspecific_highmem_32bit_test.dart [test/ffi] Fix errors in tests 2021-09-28 13:17:01 +00:00
vmspecific_leaf_call_test.dart [test/ffi] Fix errors in tests 2021-09-28 13:17:01 +00:00
vmspecific_native_finalizer_2_test.dart [vm] Implement NativeFinalizer 2022-03-26 09:41:21 +00:00
vmspecific_native_finalizer_isolate_groups_test.dart [vm] Implement NativeFinalizer 2022-03-26 09:41:21 +00:00
vmspecific_native_finalizer_isolates_test.dart [vm/isolates] Introduce 'vm:isolate-unsendable' pragma. 2023-03-27 20:54:11 +00:00
vmspecific_native_finalizer_test.dart [vm] Implement NativeFinalizer 2022-03-26 09:41:21 +00:00
vmspecific_null_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_object_gc_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_regress_37100_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_regress_37511_callbacks_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_regress_37511_test.dart [vm] Removes FLAG_enable_testing_pragmas from native_api_impl 2021-05-21 07:04:37 +00:00
vmspecific_regress_37780_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_regress_38993_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_send_port_id_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
vmspecific_static_checks_test.dart [misc] Cleanup stale todos 2022-06-28 16:02:53 +00:00
vmspecific_variance_function_checks_test.dart Fix typos 2022-09-16 19:35:00 +00:00