Skip to content

Commit 05e60a1

Browse files
authored
Remove redundant clearing of pthread struct internals. NFC (#17042)
Both these locations end up calling `_emscripten_thread_free_data` which already clears the entire struct: ``` // To aid in debugging set all fields to zero memset(t, 0, sizeof(*t)); ```
1 parent a8db2bb commit 05e60a1

File tree

3 files changed

+0
-4
lines changed

3 files changed

+0
-4
lines changed

src/library_pthread.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ var LibraryPThread = {
441441
assert(!ENVIRONMENT_IS_PTHREAD, 'Internal Error! killThread() can only ever be called from main application thread!');
442442
assert(pthread_ptr, 'Internal Error! Null pthread_ptr in killThread!');
443443
#endif
444-
{{{ makeSetValue('pthread_ptr', C_STRUCTS.pthread.self, 0, 'i32') }}};
445444
var pthread = PThread.pthreads[pthread_ptr];
446445
delete PThread.pthreads[pthread_ptr];
447446
pthread.worker.terminate();
@@ -469,7 +468,6 @@ var LibraryPThread = {
469468
#endif
470469
var pthread = PThread.pthreads[pthread_ptr];
471470
assert(pthread);
472-
{{{ makeSetValue('pthread_ptr', C_STRUCTS.pthread.self, 0, 'i32') }}};
473471
var worker = pthread.worker;
474472
PThread.returnWorkerToPool(worker);
475473
},

src/struct_info_internal.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"structs": {
88
"pthread": [
99
"profilerBlock",
10-
"self",
1110
"tsd",
1211
"stack",
1312
"stack_size",

tests/reference_struct_info.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,6 @@
13721372
"profilerBlock": 104,
13731373
"result": 56,
13741374
"robust_list": 68,
1375-
"self": 0,
13761375
"stack": 44,
13771376
"stack_owned": 108,
13781377
"stack_size": 48,

0 commit comments

Comments
 (0)