Skip to content

Commit ee4fe8a

Browse files
authored
[ptheads] Rename receiveObjectTransfer. NFC (emscripten-core#23641)
Followup to emscripten-core#14875. The name receiveObjectTransfer implies that all kinds of things can be received but its really only for the offscreen canvas.
1 parent 5998b65 commit ee4fe8a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/lib/libpthread.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,17 +203,17 @@ var LibraryPThread = {
203203
// linear memory.
204204
__emscripten_thread_free_data(pthread_ptr);
205205
},
206-
receiveObjectTransfer(data) {
207206
#if OFFSCREENCANVAS_SUPPORT
207+
receiveOffscreenCanvases(data) {
208208
if (typeof GL != 'undefined') {
209209
Object.assign(GL.offscreenCanvases, data.offscreenCanvases);
210210
if (!Module['canvas'] && data.moduleCanvasId && GL.offscreenCanvases[data.moduleCanvasId]) {
211211
Module['canvas'] = GL.offscreenCanvases[data.moduleCanvasId].offscreenCanvas;
212212
Module['canvas'].id = data.moduleCanvasId;
213213
}
214214
}
215-
#endif
216215
},
216+
#endif
217217
// Called by worker.js each time a thread is started.
218218
threadInitTLS() {
219219
#if PTHREADS_DEBUG

src/runtime_pthread.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ if (ENVIRONMENT_IS_PTHREAD) {
157157
// Pass the thread address to wasm to store it for fast access.
158158
__emscripten_thread_init(msgData.pthread_ptr, /*is_main=*/0, /*is_runtime=*/0, /*can_block=*/1, 0, 0);
159159

160-
PThread.receiveObjectTransfer(msgData);
160+
#if OFFSCREENCANVAS_SUPPORT
161+
PThread.receiveOffscreenCanvases(msgData);
162+
#endif
161163
PThread.threadInitTLS();
162164

163165
// Await mailbox notifications with `Atomics.waitAsync` so we can start

0 commit comments

Comments
 (0)