(source, value, memory)
| 128 | } |
| 129 | |
| 130 | function receiveMessageFromWorker(source, value, memory) { |
| 131 | let response = WORKER_MESSAGING_RESULT_NO_LISTENERS; |
| 132 | |
| 133 | try { |
| 134 | if (process.emit('workerMessage', value, source)) { |
| 135 | response = WORKER_MESSAGING_RESULT_DELIVERED; |
| 136 | } |
| 137 | } catch { |
| 138 | response = WORKER_MESSAGING_RESULT_LISTENER_ERROR; |
| 139 | } |
| 140 | |
| 141 | // Populate the result |
| 142 | const status = new Int32Array(memory); |
| 143 | AtomicsStore(status, WORKER_MESSAGING_RESULT_INDEX, response); |
| 144 | AtomicsStore(status, WORKER_MESSAGING_STATUS_INDEX, 1); |
| 145 | AtomicsNotify(status, WORKER_MESSAGING_STATUS_INDEX, 1); |
| 146 | } |
| 147 | |
| 148 | function createMainThreadPort(threadId) { |
| 149 | // Create a channel that links the new thread to the main thread |
no test coverage detected
searching dependent graphs…