Skip to content

Commit

Permalink
Fix default schedulers on Linux and Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Melchior committed Sep 6, 2023
1 parent bbc78aa commit b07d17b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ actual object RealmInterop {
}

actual fun realm_create_scheduler(): RealmSchedulerPointer =
LongPointerWrapper(realmc.realm_scheduler_make_default())
LongPointerWrapper(realmc.realm_create_generic_scheduler())

actual fun realm_create_scheduler(dispatcher: CoroutineDispatcher): RealmSchedulerPointer =
LongPointerWrapper(realmc.realm_create_scheduler(JVMScheduler(dispatcher)))
Expand Down
5 changes: 5 additions & 0 deletions packages/jni-swig-stub/src/main/jni/realm_api_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,3 +1048,8 @@ realm_sync_thread_error(realm_userdata_t userdata, const char* error) {
env->CallVoidMethod(static_cast<jobject>(userdata), java_callback_method, to_jstring(env, msg));
jni_check_exception(env);
}

realm_scheduler_t*
realm_create_generic_scheduler() {
return new realm_scheduler_t{realm::util::Scheduler::make_generic()};
}
3 changes: 3 additions & 0 deletions packages/jni-swig-stub/src/main/jni/realm_api_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,7 @@ realm_sync_thread_destroyed(realm_userdata_t userdata);
void
realm_sync_thread_error(realm_userdata_t userdata, const char* error);

realm_scheduler_t*
realm_create_generic_scheduler();

#endif //TEST_REALM_API_HELPERS_H

0 comments on commit b07d17b

Please sign in to comment.