���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /home/real/node-v13.0.1/test/parallel/ |
// Flags: --expose-internals 'use strict'; const common = require('../common'); if (common.isWindows) { // No way to send CTRL_C_EVENT to processes from JS right now. common.skip('platform not supported'); } const assert = require('assert'); const { internalBinding } = require('internal/test/binding'); const binding = internalBinding('contextify'); [(next) => { // Test with no signal observed. binding.startSigintWatchdog(); const hadPendingSignals = binding.stopSigintWatchdog(); assert.strictEqual(hadPendingSignals, false); next(); }, (next) => { // Test with one call to the watchdog, one signal. binding.startSigintWatchdog(); process.kill(process.pid, 'SIGINT'); waitForPendingSignal(common.mustCall(() => { const hadPendingSignals = binding.stopSigintWatchdog(); assert.strictEqual(hadPendingSignals, true); next(); })); }, (next) => { // Nested calls are okay. binding.startSigintWatchdog(); binding.startSigintWatchdog(); process.kill(process.pid, 'SIGINT'); waitForPendingSignal(common.mustCall(() => { const hadPendingSignals1 = binding.stopSigintWatchdog(); const hadPendingSignals2 = binding.stopSigintWatchdog(); assert.strictEqual(hadPendingSignals1, true); assert.strictEqual(hadPendingSignals2, false); next(); })); }, () => { // Signal comes in after first call to stop. binding.startSigintWatchdog(); binding.startSigintWatchdog(); const hadPendingSignals1 = binding.stopSigintWatchdog(); process.kill(process.pid, 'SIGINT'); waitForPendingSignal(common.mustCall(() => { const hadPendingSignals2 = binding.stopSigintWatchdog(); assert.strictEqual(hadPendingSignals1, false); assert.strictEqual(hadPendingSignals2, true); })); }].reduceRight((a, b) => common.mustCall(b).bind(null, a))(); function waitForPendingSignal(cb) { if (binding.watchdogHasPendingSigint()) cb(); else setTimeout(waitForPendingSignal, 10, cb); }