mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-06 23:54:03 +00:00
commit
2a056dce3c
@ -2176,6 +2176,8 @@ int StringRef::WriteLatin1(const EcmaVM *vm, char *buffer, int length)
|
||||
|
||||
Local<StringRef> StringRef::GetNapiWrapperString(const EcmaVM *vm)
|
||||
{
|
||||
// Omit exception check because ark calls here may not
|
||||
// cause side effect even pending exception exists.
|
||||
CROSS_THREAD_CHECK(vm);
|
||||
ecmascript::ThreadManagedScope managedScope(vm->GetJSThread());
|
||||
JSHandle<JSTaggedValue> napiWapperString = thread->GlobalConstants()->GetHandledNapiWrapperString();
|
||||
|
@ -2414,15 +2414,15 @@ HWTEST_F_L0(JSSerializerTest, SerializeMultiThreadJSSharedSet)
|
||||
for (int i = 0; i < INITIALIZE_SIZE; i++) {
|
||||
JSSharedSet::Add(thread, jsSet, JSHandle<JSTaggedValue>(thread, JSTaggedValue(i)));
|
||||
}
|
||||
constexpr uint32_t MAX_NUM_DESERIALZIERS = 10;
|
||||
JSDeserializerTest jsDeserializerTests[MAX_NUM_DESERIALZIERS];
|
||||
std::thread threads[MAX_NUM_DESERIALZIERS];
|
||||
for (int32_t i = 0; i < MAX_NUM_DESERIALZIERS; i++) {
|
||||
constexpr uint32_t maxNumDeserializers = 10;
|
||||
JSDeserializerTest jsDeserializerTests[maxNumDeserializers];
|
||||
std::thread threads[maxNumDeserializers];
|
||||
for (int32_t i = 0; i < maxNumDeserializers; i++) {
|
||||
threads[i] = std::thread(&JSDeserializerTest::JSSharedSetMultiThreadTest1,
|
||||
jsDeserializerTests[i], data.get());
|
||||
}
|
||||
ThreadSuspensionScope scope(thread);
|
||||
for (int i = 0; i < MAX_NUM_DESERIALZIERS; i++) {
|
||||
for (int i = 0; i < maxNumDeserializers; i++) {
|
||||
threads[i].join();
|
||||
}
|
||||
EXPECT_TRUE(jsSet->GetModRecord() == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user