(port)
| 181 | } |
| 182 | |
| 183 | function setupMainThreadPort(port) { |
| 184 | mainThreadPort = port; |
| 185 | mainThreadPort.on('message', handleMessageFromMainThread); |
| 186 | |
| 187 | // Never block the process on this port |
| 188 | mainThreadPort.unref(); |
| 189 | } |
| 190 | |
| 191 | async function postMessageToThread(threadId, value, transferList, timeout) { |
| 192 | if (typeof transferList === 'number' && typeof timeout === 'undefined') { |
no test coverage detected