Skip to content

Commit 4f3f13b

Browse files
committed
Move r_task() initialization after R was set up
1 parent 191c964 commit 4f3f13b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/ark/src/interface.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,6 @@ impl RMain {
311311
let (tasks_interrupt_tx, tasks_interrupt_rx) = unbounded::<RTask>();
312312
let (tasks_idle_tx, tasks_idle_rx) = unbounded::<RTask>();
313313

314-
r_task::initialize(tasks_interrupt_tx.clone(), tasks_idle_tx.clone());
315-
316314
unsafe {
317315
R_MAIN = Some(RMain::new(
318316
kernel_mutex,
@@ -416,6 +414,9 @@ impl RMain {
416414
// Set up the global error handler (after support function initialization)
417415
errors::initialize();
418416

417+
// Now allow interrupt-time tasks to run
418+
r_task::initialize(tasks_interrupt_tx, tasks_idle_tx);
419+
419420
// Now that R has started (emitting any startup messages), and now that we have set
420421
// up all hooks and handlers, officially finish the R initialization process to
421422
// unblock the kernel-info request and also allow the LSP to start.

0 commit comments

Comments
 (0)