11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst { Worker } = require('worker_threads');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci// Check that worker.unref() makes the 'exit' event not be emitted, if it is
61cb0ef41Sopenharmony_ci// the only thing we would otherwise be waiting for.
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_ci// Use `setInterval()` to make sure the worker is alive until the end of the
91cb0ef41Sopenharmony_ci// event loop turn.
101cb0ef41Sopenharmony_ciconst w = new Worker('setInterval(() => {}, 100);', { eval: true });
111cb0ef41Sopenharmony_ciw.unref();
121cb0ef41Sopenharmony_ciw.on('exit', common.mustNotCall());
13