greg 4d1d2f8c52
Some checks failed
continuous-integration/drone Build is failing
maj
2023-06-11 20:17:11 +02:00

17 lines
256 B
JavaScript

'use strict';
var threadId;
try {
var Worker = require('worker_threads');
if (Worker.isMainThread) {
threadId = -1;
} else {
threadId = Worker.threadId;
}
} catch (e) {
// no worker support
threadId = -1;
}
module.exports = threadId;